Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature | ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature | ||||
; RUN: opt -S -passes=deadargelim < %s | FileCheck %s | ; RUN: opt -S -passes=deadargelim < %s | FileCheck %s | ||||
; Apart from checking if debug metadata is correctly propagated, this also tests whether DW_CC_nocall | ; Apart from checking if debug metadata is correctly propagated, this also tests whether DW_CC_nocall | ||||
; calling convention is added when either return values or arguments are removed. | ; calling convention is added when either return values or arguments are removed. | ||||
@.str = private constant [1 x i8] zeroinitializer, align 1 ; <ptr> [#uses=1] | @.str = private constant [1 x i8] zeroinitializer, align 1 ; <ptr> [#uses=1] | ||||
define ptr @vfs_addname(ptr %name, i32 %len, i32 %hash, i32 %flags) nounwind ssp !dbg !1 { | define ptr @vfs_addname(ptr %name, i32 %len, i32 %hash, i32 %flags) nounwind ssp !dbg !1 { | ||||
; | ; | ||||
; CHECK-LABEL: define {{[^@]+}}@vfs_addname | |||||
; CHECK-SAME: (ptr [[NAME:%.*]], i32 [[LEN:%.*]], i32 [[HASH:%.*]], i32 [[FLAGS:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG4:![0-9]+]] { | |||||
; CHECK-NEXT: entry: | |||||
; CHECK-NEXT: call void @llvm.dbg.value(metadata ptr [[NAME]], metadata [[META11:![0-9]+]], metadata !DIExpression()), !dbg [[DBG12:![0-9]+]] | |||||
; CHECK-NEXT: call void @llvm.dbg.value(metadata i32 [[LEN]], metadata [[META13:![0-9]+]], metadata !DIExpression()), !dbg [[DBG12]] | |||||
; CHECK-NEXT: call void @llvm.dbg.value(metadata i32 [[HASH]], metadata [[META14:![0-9]+]], metadata !DIExpression()), !dbg [[DBG12]] | |||||
; CHECK-NEXT: call void @llvm.dbg.value(metadata i32 [[FLAGS]], metadata [[META15:![0-9]+]], metadata !DIExpression()), !dbg [[DBG12]] | |||||
; CHECK-NEXT: [[TMP0:%.*]] = call fastcc ptr @add_name_internal(ptr [[NAME]], i32 [[HASH]]) #[[ATTR3:[0-9]+]], !dbg [[DBG16:![0-9]+]] | |||||
; CHECK-NEXT: ret ptr [[TMP0]], !dbg [[DBG16]] | |||||
; | |||||
entry: | entry: | ||||
call void @llvm.dbg.value(metadata ptr %name, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1) | call void @llvm.dbg.value(metadata ptr %name, metadata !0, metadata !DIExpression()), !dbg !DILocation(scope: !1) | ||||
call void @llvm.dbg.value(metadata i32 %len, metadata !10, metadata !DIExpression()), !dbg !DILocation(scope: !1) | call void @llvm.dbg.value(metadata i32 %len, metadata !10, metadata !DIExpression()), !dbg !DILocation(scope: !1) | ||||
call void @llvm.dbg.value(metadata i32 %hash, metadata !11, metadata !DIExpression()), !dbg !DILocation(scope: !1) | call void @llvm.dbg.value(metadata i32 %hash, metadata !11, metadata !DIExpression()), !dbg !DILocation(scope: !1) | ||||
call void @llvm.dbg.value(metadata i32 %flags, metadata !12, metadata !DIExpression()), !dbg !DILocation(scope: !1) | call void @llvm.dbg.value(metadata i32 %flags, metadata !12, metadata !DIExpression()), !dbg !DILocation(scope: !1) | ||||
; CHECK: call fastcc ptr @add_name_internal(ptr %name, i32 %hash) [[NUW:#[0-9]+]], !dbg !{{[0-9]+}} | |||||
%0 = call fastcc ptr @add_name_internal(ptr %name, i32 %len, i32 %hash, i8 zeroext 0, i32 %flags) nounwind, !dbg !13 ; <ptr> [#uses=1] | %0 = call fastcc ptr @add_name_internal(ptr %name, i32 %len, i32 %hash, i8 zeroext 0, i32 %flags) nounwind, !dbg !13 ; <ptr> [#uses=1] | ||||
ret ptr %0, !dbg !13 | ret ptr %0, !dbg !13 | ||||
} | } | ||||
declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone | declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone | ||||
define internal fastcc ptr @add_name_internal(ptr %name, i32 %len, i32 %hash, i8 zeroext %extra, i32 %flags) noinline nounwind ssp !dbg !16 { | define internal fastcc ptr @add_name_internal(ptr %name, i32 %len, i32 %hash, i8 zeroext %extra, i32 %flags) noinline nounwind ssp !dbg !16 { | ||||
; | ; | ||||
; CHECK-LABEL: define {{[^@]+}}@add_name_internal | |||||
; CHECK-SAME: (ptr [[NAME:%.*]], i32 [[HASH:%.*]]) #[[ATTR2:[0-9]+]] !dbg [[DBG18:![0-9]+]] { | |||||
; CHECK-NEXT: entry: | |||||
; CHECK-NEXT: call void @llvm.dbg.value(metadata ptr [[NAME]], metadata [[META22:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23:![0-9]+]] | |||||
; CHECK-NEXT: call void @llvm.dbg.value(metadata i32 poison, metadata [[META24:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23]] | |||||
; CHECK-NEXT: call void @llvm.dbg.value(metadata i32 [[HASH]], metadata [[META25:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23]] | |||||
; CHECK-NEXT: call void @llvm.dbg.value(metadata i8 poison, metadata [[META26:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23]] | |||||
; CHECK-NEXT: call void @llvm.dbg.value(metadata i32 poison, metadata [[META27:![0-9]+]], metadata !DIExpression()), !dbg [[DBG23]] | |||||
; CHECK-NEXT: [[TMP0:%.*]] = icmp eq i32 [[HASH]], 0, !dbg [[DBG28:![0-9]+]] | |||||
; CHECK-NEXT: br i1 [[TMP0]], label [[BB:%.*]], label [[BB1:%.*]], !dbg [[DBG28]] | |||||
; CHECK: bb: | |||||
; CHECK-NEXT: br label [[BB2:%.*]], !dbg [[DBG30:![0-9]+]] | |||||
; CHECK: bb1: | |||||
; CHECK-NEXT: br label [[BB2]], !dbg [[DBG31:![0-9]+]] | |||||
; CHECK: bb2: | |||||
; CHECK-NEXT: [[DOT0:%.*]] = phi ptr [ @.str, [[BB]] ], [ [[NAME]], [[BB1]] ] | |||||
; CHECK-NEXT: ret ptr [[DOT0]], !dbg [[DBG31]] | |||||
; | |||||
entry: | entry: | ||||
call void @llvm.dbg.value(metadata ptr %name, metadata !15, metadata !DIExpression()), !dbg !DILocation(scope: !16) | call void @llvm.dbg.value(metadata ptr %name, metadata !15, metadata !DIExpression()), !dbg !DILocation(scope: !16) | ||||
call void @llvm.dbg.value(metadata i32 %len, metadata !20, metadata !DIExpression()), !dbg !DILocation(scope: !16) | call void @llvm.dbg.value(metadata i32 %len, metadata !20, metadata !DIExpression()), !dbg !DILocation(scope: !16) | ||||
call void @llvm.dbg.value(metadata i32 %hash, metadata !21, metadata !DIExpression()), !dbg !DILocation(scope: !16) | call void @llvm.dbg.value(metadata i32 %hash, metadata !21, metadata !DIExpression()), !dbg !DILocation(scope: !16) | ||||
call void @llvm.dbg.value(metadata i8 %extra, metadata !22, metadata !DIExpression()), !dbg !DILocation(scope: !16) | call void @llvm.dbg.value(metadata i8 %extra, metadata !22, metadata !DIExpression()), !dbg !DILocation(scope: !16) | ||||
call void @llvm.dbg.value(metadata i32 %flags, metadata !23, metadata !DIExpression()), !dbg !DILocation(scope: !16) | call void @llvm.dbg.value(metadata i32 %flags, metadata !23, metadata !DIExpression()), !dbg !DILocation(scope: !16) | ||||
%0 = icmp eq i32 %hash, 0, !dbg !24 ; <i1> [#uses=1] | %0 = icmp eq i32 %hash, 0, !dbg !24 ; <i1> [#uses=1] | ||||
br i1 %0, label %bb, label %bb1, !dbg !24 | br i1 %0, label %bb, label %bb1, !dbg !24 | ||||
Show All 9 Lines | bb2: ; preds = %bb1, %bb | ||||
ret ptr %.0, !dbg !27 | ret ptr %.0, !dbg !27 | ||||
} | } | ||||
declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone | declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone | ||||
; CHECK: attributes #0 = { nounwind ssp } | ; CHECK: attributes #0 = { nounwind ssp } | ||||
; CHECK: attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } | ; CHECK: attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } | ||||
; CHECK: attributes #2 = { noinline nounwind ssp } | ; CHECK: attributes #2 = { noinline nounwind ssp } | ||||
; CHECK: attributes [[NUW]] = { nounwind } | |||||
!llvm.dbg.cu = !{!3} | !llvm.dbg.cu = !{!3} | ||||
!llvm.module.flags = !{!30} | !llvm.module.flags = !{!30} | ||||
!0 = !DILocalVariable(name: "name", line: 8, arg: 1, scope: !1, file: !2, type: !6) | !0 = !DILocalVariable(name: "name", line: 8, arg: 1, scope: !1, file: !2, type: !6) | ||||
!1 = distinct !DISubprogram(name: "vfs_addname", linkageName: "vfs_addname", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, file: !28, scope: !2, type: !4) | !1 = distinct !DISubprogram(name: "vfs_addname", linkageName: "vfs_addname", line: 12, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, file: !28, scope: !2, type: !4) | ||||
!2 = !DIFile(filename: "tail.c", directory: "/Users/echeng/LLVM/radars/r7927803/") | !2 = !DIFile(filename: "tail.c", directory: "/Users/echeng/LLVM/radars/r7927803/") | ||||
!3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)", isOptimized: true, emissionKind: FullDebug, file: !28, enums: !29, retainedTypes: !29) | !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)", isOptimized: true, emissionKind: FullDebug, file: !28, enums: !29, retainedTypes: !29) | ||||
!4 = !DISubroutineType(types: !5) | !4 = !DISubroutineType(types: !5) | ||||
!5 = !{!6, !6, !9, !9, !9} | !5 = !{!6, !6, !9, !9, !9} | ||||
!6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !28, scope: !2, baseType: !7) | !6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !28, scope: !2, baseType: !7) | ||||
!7 = !DIDerivedType(tag: DW_TAG_const_type, size: 8, align: 8, file: !28, scope: !2, baseType: !8) | !7 = !DIDerivedType(tag: DW_TAG_const_type, size: 8, align: 8, file: !28, scope: !2, baseType: !8) | ||||
!8 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) | !8 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) | ||||
!9 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) | !9 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) | ||||
!10 = !DILocalVariable(name: "len", line: 9, arg: 2, scope: !1, file: !2, type: !9) | !10 = !DILocalVariable(name: "len", line: 9, arg: 2, scope: !1, file: !2, type: !9) | ||||
!11 = !DILocalVariable(name: "hash", line: 10, arg: 3, scope: !1, file: !2, type: !9) | !11 = !DILocalVariable(name: "hash", line: 10, arg: 3, scope: !1, file: !2, type: !9) | ||||
!12 = !DILocalVariable(name: "flags", line: 11, arg: 4, scope: !1, file: !2, type: !9) | !12 = !DILocalVariable(name: "flags", line: 11, arg: 4, scope: !1, file: !2, type: !9) | ||||
!13 = !DILocation(line: 13, scope: !14) | !13 = !DILocation(line: 13, scope: !14) | ||||
!14 = distinct !DILexicalBlock(line: 12, column: 0, file: !28, scope: !1) | !14 = distinct !DILexicalBlock(line: 12, column: 0, file: !28, scope: !1) | ||||
!15 = !DILocalVariable(name: "name", line: 17, arg: 1, scope: !16, file: !2, type: !6) | !15 = !DILocalVariable(name: "name", line: 17, arg: 1, scope: !16, file: !2, type: !6) | ||||
; CHECK: !DISubprogram(name: "add_name_internal" | ; CHECK: !DISubprogram(name: "add_name_internal" | ||||
; CHECK-SAME: type: ![[MD:[0-9]+]] | |||||
!16 = distinct !DISubprogram(name: "add_name_internal", linkageName: "add_name_internal", line: 22, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, file: !28, scope: !2, type: !17) | !16 = distinct !DISubprogram(name: "add_name_internal", linkageName: "add_name_internal", line: 22, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, file: !28, scope: !2, type: !17) | ||||
; CHECK: ![[MD]] = !DISubroutineType(cc: DW_CC_nocall, types: !{{[0-9]+}}) | |||||
!17 = !DISubroutineType(types: !18) | !17 = !DISubroutineType(types: !18) | ||||
!18 = !{!6, !6, !9, !9, !19, !9} | !18 = !{!6, !6, !9, !9, !19, !9} | ||||
!19 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char) | !19 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char) | ||||
!20 = !DILocalVariable(name: "len", line: 18, arg: 2, scope: !16, file: !2, type: !9) | !20 = !DILocalVariable(name: "len", line: 18, arg: 2, scope: !16, file: !2, type: !9) | ||||
!21 = !DILocalVariable(name: "hash", line: 19, arg: 3, scope: !16, file: !2, type: !9) | !21 = !DILocalVariable(name: "hash", line: 19, arg: 3, scope: !16, file: !2, type: !9) | ||||
!22 = !DILocalVariable(name: "extra", line: 20, arg: 4, scope: !16, file: !2, type: !19) | !22 = !DILocalVariable(name: "extra", line: 20, arg: 4, scope: !16, file: !2, type: !19) | ||||
!23 = !DILocalVariable(name: "flags", line: 21, arg: 5, scope: !16, file: !2, type: !9) | !23 = !DILocalVariable(name: "flags", line: 21, arg: 5, scope: !16, file: !2, type: !9) | ||||
!24 = !DILocation(line: 23, scope: !25) | !24 = !DILocation(line: 23, scope: !25) | ||||
!25 = distinct !DILexicalBlock(line: 22, column: 0, file: !28, scope: !16) | !25 = distinct !DILexicalBlock(line: 22, column: 0, file: !28, scope: !16) | ||||
!26 = !DILocation(line: 24, scope: !25) | !26 = !DILocation(line: 24, scope: !25) | ||||
!27 = !DILocation(line: 26, scope: !25) | !27 = !DILocation(line: 26, scope: !25) | ||||
!28 = !DIFile(filename: "tail.c", directory: "/Users/echeng/LLVM/radars/r7927803/") | !28 = !DIFile(filename: "tail.c", directory: "/Users/echeng/LLVM/radars/r7927803/") | ||||
!29 = !{} | !29 = !{} | ||||
!30 = !{i32 1, !"Debug Info Version", i32 3} | !30 = !{i32 1, !"Debug Info Version", i32 3} | ||||
nikic: Why the changes to this file? I don't see any musttail usage. | |||||
mtrofinAuthorUnsubmitted Misunderstanding on my part. mtrofin: Misunderstanding on my part. |
Why the changes to this file? I don't see any musttail usage.