diff options
author | Adrian Prantl <aprantl@apple.com> | 2017-05-04 16:24:31 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2017-05-04 16:24:31 +0000 |
commit | defc99a94e849acd29a8bb492f6611cd3f4ff2f8 (patch) | |
tree | 63bec638081c5f0c7cecbd2750dc050337051729 /llvm/test/Transforms | |
parent | c6bf797e2044a93fa7cce9b243febcab454ba791 (diff) | |
download | bcm5719-llvm-defc99a94e849acd29a8bb492f6611cd3f4ff2f8.tar.gz bcm5719-llvm-defc99a94e849acd29a8bb492f6611cd3f4ff2f8.zip |
Cleanup tests to not share a DISubprogram between multiple Functions.
rdar://problem/31926379
llvm-svn: 302166
Diffstat (limited to 'llvm/test/Transforms')
5 files changed, 142 insertions, 93 deletions
diff --git a/llvm/test/Transforms/CodeExtractor/PartialInlineOptRemark.ll b/llvm/test/Transforms/CodeExtractor/PartialInlineOptRemark.ll index b2442b8b173..c0d89d606d6 100644 --- a/llvm/test/Transforms/CodeExtractor/PartialInlineOptRemark.ll +++ b/llvm/test/Transforms/CodeExtractor/PartialInlineOptRemark.ll @@ -32,52 +32,52 @@ bb2: ; preds = %bb1, %bb ret i32 %tmp3, !dbg !19 } -define i32 @bar_noinline(i32 %arg) local_unnamed_addr #1 !dbg !5 { +define i32 @bar_noinline(i32 %arg) local_unnamed_addr #1 !dbg !23 { bb: - %tmp = icmp slt i32 %arg, 0, !dbg !7 - br i1 %tmp, label %bb1, label %bb2, !dbg !8 + %tmp = icmp slt i32 %arg, 0, !dbg !24 + br i1 %tmp, label %bb1, label %bb2, !dbg !24 bb1: ; preds = %bb - tail call void (...) @foo() #0, !dbg !9 - tail call void (...) @foo() #0, !dbg !10 - tail call void (...) @foo() #0, !dbg !11 - br label %bb2, !dbg !18 + tail call void (...) @foo() #0, !dbg !24 + tail call void (...) @foo() #0, !dbg !24 + tail call void (...) @foo() #0, !dbg !24 + br label %bb2, !dbg !24 bb2: ; preds = %bb1, %bb %tmp3 = phi i32 [ 0, %bb1 ], [ 1, %bb ] - ret i32 %tmp3, !dbg !19 + ret i32 %tmp3, !dbg !24 } -define i32 @bar_alwaysinline(i32 %arg) local_unnamed_addr #2 !dbg !5 { +define i32 @bar_alwaysinline(i32 %arg) local_unnamed_addr #2 !dbg !25 { bb: - %tmp = icmp slt i32 %arg, 0, !dbg !7 - br i1 %tmp, label %bb1, label %bb2, !dbg !8 + %tmp = icmp slt i32 %arg, 0, !dbg !26 + br i1 %tmp, label %bb1, label %bb2, !dbg !26 bb1: ; preds = %bb - tail call void (...) @foo() #0, !dbg !9 - tail call void (...) @foo() #0, !dbg !10 - tail call void (...) @foo() #0, !dbg !11 - br label %bb2, !dbg !18 + tail call void (...) @foo() #0, !dbg !26 + tail call void (...) @foo() #0, !dbg !26 + tail call void (...) @foo() #0, !dbg !26 + br label %bb2, !dbg !26 bb2: ; preds = %bb1, %bb %tmp3 = phi i32 [ 0, %bb1 ], [ 1, %bb ] - ret i32 %tmp3, !dbg !19 + ret i32 %tmp3, !dbg !26 } -define i32 @bar_cold(i32 %arg) local_unnamed_addr #3 !dbg !5 { +define i32 @bar_cold(i32 %arg) local_unnamed_addr #3 !dbg !27 { bb: - %tmp = icmp slt i32 %arg, 0, !dbg !7 - br i1 %tmp, label %bb1, label %bb2, !dbg !8 + %tmp = icmp slt i32 %arg, 0, !dbg !28 + br i1 %tmp, label %bb1, label %bb2, !dbg !28 bb1: ; preds = %bb - tail call void (...) @foo() #0, !dbg !9 - tail call void (...) @foo() #0, !dbg !10 - tail call void (...) @foo() #0, !dbg !11 - br label %bb2, !dbg !18 + tail call void (...) @foo() #0, !dbg !28 + tail call void (...) @foo() #0, !dbg !28 + tail call void (...) @foo() #0, !dbg !28 + br label %bb2, !dbg !28 bb2: ; preds = %bb1, %bb %tmp3 = phi i32 [ 0, %bb1 ], [ 1, %bb ] - ret i32 %tmp3, !dbg !19 + ret i32 %tmp3, !dbg !28 } ; Function Attrs: nounwind @@ -130,3 +130,9 @@ attributes #3 = { cold nounwind } !20 = distinct !DISubprogram(name: "dummy_caller", scope: !1, file: !1, line: 19, type: !6, isLocal: false, isDefinition: true, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2) !21 = !DILocation(line: 21, column: 11, scope: !20) !22 = !DILocation(line: 21, column: 4, scope: !20) +!23 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2) +!24 = !DILocation(line: 4, column: 6, scope: !23) +!25 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2) +!26 = !DILocation(line: 4, column: 6, scope: !25) +!27 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 3, type: !6, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2) +!28 = !DILocation(line: 4, column: 6, scope: !27) diff --git a/llvm/test/Transforms/InstCombine/debuginfo-dce.ll b/llvm/test/Transforms/InstCombine/debuginfo-dce.ll index 58e9d7d767e..086743e8082 100644 --- a/llvm/test/Transforms/InstCombine/debuginfo-dce.ll +++ b/llvm/test/Transforms/InstCombine/debuginfo-dce.ll @@ -37,60 +37,60 @@ entry: ret void, !dbg !21 } -define void @salvage_bitcast(%struct.entry* %queue) local_unnamed_addr #0 !dbg !14 { +define void @salvage_bitcast(%struct.entry* %queue) local_unnamed_addr #0 !dbg !22 { entry: %im_not_dead = alloca i8* - %0 = bitcast %struct.entry* %queue to i8*, !dbg !19 - %1 = bitcast %struct.entry* %queue to i8*, !dbg !19 - call void @llvm.dbg.value(metadata i8* %1, i64 0, metadata !18, metadata !20), !dbg !19 + %0 = bitcast %struct.entry* %queue to i8*, !dbg !23 + %1 = bitcast %struct.entry* %queue to i8*, !dbg !23 + call void @llvm.dbg.value(metadata i8* %1, i64 0, metadata !24, metadata !20), !dbg !23 ; CHECK: define void @salvage_bitcast ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @llvm.dbg.value(metadata %struct.entry* %queue, i64 0, ; CHECK-SAME: metadata ![[BITCAST_EXPR:[0-9]+]]) store i8* %1, i8** %im_not_dead, align 8 - ret void, !dbg !21 + ret void, !dbg !23 } -define void @salvage_gep0(%struct.entry* %queue, %struct.entry* %end) local_unnamed_addr #0 !dbg !14 { +define void @salvage_gep0(%struct.entry* %queue, %struct.entry* %end) local_unnamed_addr #0 !dbg !25 { entry: %im_not_dead = alloca %struct.entry** - %0 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !19 - %1 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !19 - call void @llvm.dbg.value(metadata %struct.entry** %1, i64 0, metadata !18, metadata !20), !dbg !19 + %0 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !26 + %1 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !26 + call void @llvm.dbg.value(metadata %struct.entry** %1, i64 0, metadata !27, metadata !20), !dbg !26 ; CHECK: define void @salvage_gep0 ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @llvm.dbg.value(metadata %struct.entry* %queue, i64 0, ; CHECK-SAME: metadata ![[GEP0_EXPR:[0-9]+]]) store %struct.entry** %1, %struct.entry*** %im_not_dead, align 8 - ret void, !dbg !21 + ret void, !dbg !26 } -define void @salvage_gep1(%struct.entry* %queue, %struct.entry* %end) local_unnamed_addr #0 !dbg !14 { +define void @salvage_gep1(%struct.entry* %queue, %struct.entry* %end) local_unnamed_addr #0 !dbg !28 { entry: %im_not_dead = alloca %struct.entry** - %0 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !19 - %1 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !19 - call void @llvm.dbg.value(metadata %struct.entry** %1, i64 0, metadata !18, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !19 + %0 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !29 + %1 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !29 + call void @llvm.dbg.value(metadata %struct.entry** %1, i64 0, metadata !30, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !29 ; CHECK: define void @salvage_gep1 ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @llvm.dbg.value(metadata %struct.entry* %queue, i64 0, ; CHECK-SAME: metadata ![[GEP1_EXPR:[0-9]+]]) store %struct.entry** %1, %struct.entry*** %im_not_dead, align 8 - ret void, !dbg !21 + ret void, !dbg !29 } -define void @salvage_gep2(%struct.entry* %queue, %struct.entry* %end) local_unnamed_addr #0 !dbg !14 { +define void @salvage_gep2(%struct.entry* %queue, %struct.entry* %end) local_unnamed_addr #0 !dbg !31 { entry: %im_not_dead = alloca %struct.entry** - %0 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !19 - %1 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !19 - call void @llvm.dbg.value(metadata %struct.entry** %1, i64 0, metadata !18, metadata !DIExpression(DW_OP_stack_value)), !dbg !19 + %0 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !32 + %1 = getelementptr inbounds %struct.entry, %struct.entry* %queue, i32 -1, i32 0, !dbg !32 + call void @llvm.dbg.value(metadata %struct.entry** %1, i64 0, metadata !33, metadata !DIExpression(DW_OP_stack_value)), !dbg !32 ; CHECK: define void @salvage_gep2 ; CHECK-NEXT: entry: ; CHECK-NEXT: call void @llvm.dbg.value(metadata %struct.entry* %queue, i64 0, ; CHECK-SAME: metadata ![[GEP2_EXPR:[0-9]+]]) store %struct.entry** %1, %struct.entry*** %im_not_dead, align 8 - ret void, !dbg !21 + ret void, !dbg !32 } ; CHECK: ![[LOAD_EXPR]] = !DIExpression(DW_OP_deref, DW_OP_plus, 0) @@ -132,3 +132,15 @@ attributes #1 = { nounwind readnone } !19 = !DILocation(line: 6, column: 17, scope: !14) !20 = !DIExpression(DW_OP_plus, 0) !21 = !DILocation(line: 11, column: 1, scope: !14) +!22 = distinct !DISubprogram(name: "scan", scope: !1, file: !1, line: 4, type: !15, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !17) +!23 = !DILocation(line: 6, column: 17, scope: !22) +!24 = !DILocalVariable(name: "entry", scope: !22, file: !1, line: 6, type: !4) +!25 = distinct !DISubprogram(name: "scan", scope: !1, file: !1, line: 4, type: !15, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !17) +!26 = !DILocation(line: 6, column: 17, scope: !25) +!27 = !DILocalVariable(name: "entry", scope: !25, file: !1, line: 6, type: !4) +!28 = distinct !DISubprogram(name: "scan", scope: !1, file: !1, line: 4, type: !15, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !17) +!29 = !DILocation(line: 6, column: 17, scope: !28) +!30 = !DILocalVariable(name: "entry", scope: !28, file: !1, line: 6, type: !4) +!31 = distinct !DISubprogram(name: "scan", scope: !1, file: !1, line: 4, type: !15, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !17) +!32 = !DILocation(line: 6, column: 17, scope: !31) +!33 = !DILocalVariable(name: "entry", scope: !31, file: !1, line: 6, type: !4) diff --git a/llvm/test/Transforms/LoopRotate/dbgvalue.ll b/llvm/test/Transforms/LoopRotate/dbgvalue.ll index 9ff8bda4bc0..90105047f86 100644 --- a/llvm/test/Transforms/LoopRotate/dbgvalue.ll +++ b/llvm/test/Transforms/LoopRotate/dbgvalue.ll @@ -38,7 +38,7 @@ return: ; preds = %if.end ret i32 %z.tr, !dbg !17 } -define i32 @tak2(i32 %x, i32 %y, i32 %z) nounwind ssp !dbg !0 { +define i32 @tak2(i32 %x, i32 %y, i32 %z) nounwind ssp !dbg !21 { ; CHECK-LABEL: define i32 @tak2( ; CHECK: entry ; CHECK: tail call void @llvm.dbg.value(metadata i32 %x.tr @@ -51,29 +51,29 @@ tailrecurse: ; preds = %if.then, %entry %x.tr = phi i32 [ %x, %entry ], [ %call, %if.then ] %y.tr = phi i32 [ %y, %entry ], [ %call9, %if.then ] %z.tr = phi i32 [ %z, %entry ], [ %call14, %if.then ] - %cmp = icmp slt i32 %y.tr, %x.tr, !dbg !12 - br i1 %cmp, label %if.then, label %if.end, !dbg !12 + %cmp = icmp slt i32 %y.tr, %x.tr, !dbg !22 + br i1 %cmp, label %if.then, label %if.end, !dbg !22 if.then: ; preds = %tailrecurse - tail call void @llvm.dbg.value(metadata i32 %x.tr, i64 0, metadata !6, metadata !DIExpression()), !dbg !7 - tail call void @llvm.dbg.value(metadata i32 %y.tr, i64 0, metadata !8, metadata !DIExpression()), !dbg !9 - tail call void @llvm.dbg.value(metadata i32 %z.tr, i64 0, metadata !10, metadata !DIExpression()), !dbg !11 - %sub = sub nsw i32 %x.tr, 1, !dbg !14 - %call = tail call i32 @tak(i32 %sub, i32 %y.tr, i32 %z.tr), !dbg !14 - %sub6 = sub nsw i32 %y.tr, 1, !dbg !14 - %call9 = tail call i32 @tak(i32 %sub6, i32 %z.tr, i32 %x.tr), !dbg !14 - %sub11 = sub nsw i32 %z.tr, 1, !dbg !14 - %call14 = tail call i32 @tak(i32 %sub11, i32 %x.tr, i32 %y.tr), !dbg !14 + tail call void @llvm.dbg.value(metadata i32 %x.tr, i64 0, metadata !36, metadata !DIExpression()), !dbg !37 + tail call void @llvm.dbg.value(metadata i32 %y.tr, i64 0, metadata !38, metadata !DIExpression()), !dbg !39 + tail call void @llvm.dbg.value(metadata i32 %z.tr, i64 0, metadata !40, metadata !DIExpression()), !dbg !41 + %sub = sub nsw i32 %x.tr, 1, !dbg !24 + %call = tail call i32 @tak(i32 %sub, i32 %y.tr, i32 %z.tr), !dbg !24 + %sub6 = sub nsw i32 %y.tr, 1, !dbg !24 + %call9 = tail call i32 @tak(i32 %sub6, i32 %z.tr, i32 %x.tr), !dbg !24 + %sub11 = sub nsw i32 %z.tr, 1, !dbg !24 + %call14 = tail call i32 @tak(i32 %sub11, i32 %x.tr, i32 %y.tr), !dbg !24 br label %tailrecurse if.end: ; preds = %tailrecurse - tail call void @llvm.dbg.value(metadata i32 %x.tr, i64 0, metadata !6, metadata !DIExpression()), !dbg !7 - tail call void @llvm.dbg.value(metadata i32 %y.tr, i64 0, metadata !8, metadata !DIExpression()), !dbg !9 - tail call void @llvm.dbg.value(metadata i32 %z.tr, i64 0, metadata !10, metadata !DIExpression()), !dbg !11 - br label %return, !dbg !16 + tail call void @llvm.dbg.value(metadata i32 %x.tr, i64 0, metadata !36, metadata !DIExpression()), !dbg !37 + tail call void @llvm.dbg.value(metadata i32 %y.tr, i64 0, metadata !38, metadata !DIExpression()), !dbg !39 + tail call void @llvm.dbg.value(metadata i32 %z.tr, i64 0, metadata !40, metadata !DIExpression()), !dbg !41 + br label %return, !dbg !26 return: ; preds = %if.end - ret i32 %z.tr, !dbg !17 + ret i32 %z.tr, !dbg !27 } @channelColumns = external global i64 @@ -143,3 +143,16 @@ for.end: !17 = !DILocation(line: 37, column: 1, scope: !13) !18 = !DIFile(filename: "/Volumes/Lalgate/cj/llvm/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame/recursive.c", directory: "/Volumes/Lalgate/cj/D/projects/llvm-test/SingleSource/Benchmarks/BenchmarkGame") !20 = !{i32 1, !"Debug Info Version", i32 3} +!21 = distinct !DISubprogram(name: "tak", line: 32, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !2, file: !18, scope: !1, type: !3) +!22 = !DILocation(line: 33, column: 3, scope: !23) +!23 = distinct !DILexicalBlock(line: 32, column: 30, file: !18, scope: !21) +!24 = !DILocation(line: 34, column: 5, scope: !25) +!25 = distinct !DILexicalBlock(line: 33, column: 14, file: !18, scope: !23) +!26 = !DILocation(line: 36, column: 3, scope: !23) +!27 = !DILocation(line: 37, column: 1, scope: !23) +!36 = !DILocalVariable(name: "x", line: 32, arg: 1, scope: !21, file: !1, type: !5) +!37 = !DILocation(line: 32, column: 13, scope: !21) +!38 = !DILocalVariable(name: "y", line: 32, arg: 2, scope: !21, file: !1, type: !5) +!39 = !DILocation(line: 32, column: 20, scope: !21) +!40 = !DILocalVariable(name: "z", line: 32, arg: 3, scope: !21, file: !1, type: !5) +!41 = !DILocation(line: 32, column: 27, scope: !21) diff --git a/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof b/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof index aaf9ec15d02..ff7be5df977 100644 --- a/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof +++ b/llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof @@ -1,19 +1,19 @@ test:63067:0 - 4: 3345 _Z3barv:1398 _Z3foov:2059 + 1: 3345 _Z3barv:1398 _Z3foov:2059 test_inline:3000:0 - 5: foo_inline1:3000 - 1: 3000 - 5: foo_inline2:4000 - 1: 4000 + 1: foo_inline1:3000 + 11: 3000 + 1: foo_inline2:4000 + 19: 4000 test_noinline:3000:0 - 5: foo_noinline:3000 - 1: 3000 + 1: foo_noinline:3000 + 20: 3000 test_direct:3000:0 - 5: foo_direct:3000 - 1: 3000 + 1: foo_direct:3000 + 21: 3000 test_inline_strip:3000:0 - 5: foo_inline_strip:3000 + 1: foo_inline_strip:3000 1: 3000 -test_inline_strip_confilict:3000:0 - 5: foo_inline_strip_conflict:3000 +test_inline_strip_conflict:3000:0 + 1: foo_inline_strip_conflict:3000 1: 3000 diff --git a/llvm/test/Transforms/SampleProfile/indirect-call.ll b/llvm/test/Transforms/SampleProfile/indirect-call.ll index 4647dd42129..4101f6f492e 100644 --- a/llvm/test/Transforms/SampleProfile/indirect-call.ll +++ b/llvm/test/Transforms/SampleProfile/indirect-call.ll @@ -12,7 +12,7 @@ define void @test(void ()*) !dbg !3 { ; CHECK-LABEL: @test_inline ; If the indirect call is promoted and inlined in profile, we should promote and inline it. -define void @test_inline(i64* (i32*)*, i32* %x) !dbg !3 { +define void @test_inline(i64* (i32*)*, i32* %x) !dbg !6 { %2 = alloca i64* (i32*)* store i64* (i32*)* %0, i64* (i32*)** %2 %3 = load i64* (i32*)*, i64* (i32*)** %2 @@ -25,14 +25,14 @@ define void @test_inline(i64* (i32*)*, i32* %x) !dbg !3 { ; CHECK-NOT: call ; CHECK: if.false.orig_indirect2: ; CHECK: call - call i64* %3(i32* %x), !dbg !5 + call i64* %3(i32* %x), !dbg !7 ret void } ; CHECK-LABEL: @test_inline_strip ; If the indirect call is promoted and inlined in profile, and the callee name ; is stripped we should promote and inline it. -define void @test_inline_strip(i64* (i32*)*, i32* %x) !dbg !3 { +define void @test_inline_strip(i64* (i32*)*, i32* %x) !dbg !8 { %2 = alloca i64* (i32*)* store i64* (i32*)* %0, i64* (i32*)** %2 %3 = load i64* (i32*)*, i64* (i32*)** %2 @@ -41,74 +41,74 @@ define void @test_inline_strip(i64* (i32*)*, i32* %x) !dbg !3 { ; CHECK-NOT: call ; CHECK: if.false.orig_indirect: ; CHECK: call - call i64* %3(i32* %x), !dbg !5 + call i64* %3(i32* %x), !dbg !9 ret void } ; CHECK-LABEL: @test_inline_strip_conflict ; If the indirect call is promoted and inlined in profile, and the callee name ; is stripped, but have more than 1 potential match, we should not promote. -define void @test_inline_strip_conflict(i64* (i32*)*, i32* %x) !dbg !3 { +define void @test_inline_strip_conflict(i64* (i32*)*, i32* %x) !dbg !10 { %2 = alloca i64* (i32*)* store i64* (i32*)* %0, i64* (i32*)** %2 %3 = load i64* (i32*)*, i64* (i32*)** %2 ; CHECK-NOT: if.true.direct_targ: - call i64* %3(i32* %x), !dbg !5 + call i64* %3(i32* %x), !dbg !11 ret void } ; CHECK-LABEL: @test_noinline ; If the indirect call target is not available, we should not promote it. -define void @test_noinline(void ()*) !dbg !3 { +define void @test_noinline(void ()*) !dbg !12 { %2 = alloca void ()* store void ()* %0, void ()** %2 %3 = load void ()*, void ()** %2 ; CHECK-NOT: icmp ; CHECK: call - call void %3(), !dbg !5 + call void %3(), !dbg !13 ret void } @x = global i32 0, align 4 -define i32* @foo_inline1(i32* %x) !dbg !3 { +define i32* @foo_inline1(i32* %x) !dbg !14 { ret i32* %x } -define i32* @foo_inline_strip.suffix(i32* %x) !dbg !3 { +define i32* @foo_inline_strip.suffix(i32* %x) !dbg !15 { ret i32* %x } -define i32* @foo_inline_strip_conflict.suffix1(i32* %x) !dbg !3 { +define i32* @foo_inline_strip_conflict.suffix1(i32* %x) !dbg !16 { ret i32* %x } -define i32* @foo_inline_strip_conflict.suffix2(i32* %x) !dbg !3 { +define i32* @foo_inline_strip_conflict.suffix2(i32* %x) !dbg !17 { ret i32* %x } -define i32* @foo_inline_strip_conflict.suffix3(i32* %x) !dbg !3 { +define i32* @foo_inline_strip_conflict.suffix3(i32* %x) !dbg !18 { ret i32* %x } -define i32* @foo_inline2(i32* %x) !dbg !3 { +define i32* @foo_inline2(i32* %x) !dbg !19 { ret i32* %x } -define i32 @foo_noinline(i32 %x) !dbg !3 { +define i32 @foo_noinline(i32 %x) !dbg !20 { ret i32 %x } -define void @foo_direct() !dbg !3 { +define void @foo_direct() !dbg !21 { ret void } ; CHECK-LABEL: @test_direct ; We should not promote a direct call. -define void @test_direct() !dbg !3 { +define void @test_direct() !dbg !22 { ; CHECK-NOT: icmp ; CHECK: call - call void @foo_alias(), !dbg !5 + call void @foo_alias(), !dbg !23 ret void } @@ -120,7 +120,25 @@ define void @test_direct() !dbg !3 { !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1) !1 = !DIFile(filename: "test.cc", directory: "/") !2 = !{i32 2, !"Debug Info Version", i32 3} -!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 1, unit: !0) -!4 = !DILocation(line: 5, scope: !3) +!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 3, unit: !0) +!4 = !DILocation(line: 4, scope: !3) !5 = !DILocation(line: 6, scope: !3) ; CHECK: ![[PROF]] = !{!"VP", i32 0, i64 3457, i64 9191153033785521275, i64 2059, i64 -1069303473483922844, i64 1398} +!6 = distinct !DISubprogram(name: "test_inline", scope: !1, file: !1, line: 6, unit: !0) +!7 = !DILocation(line: 7, scope: !6) +!8 = distinct !DISubprogram(name: "test_inline_strip", scope: !1, file: !1, line: 8, unit: !0) +!9 = !DILocation(line: 9, scope: !8) +!10 = distinct !DISubprogram(name: "test_inline_strip_conflict", scope: !1, file: !1, line: 10, unit: !0) +!11 = !DILocation(line: 11, scope: !10) +!12 = distinct !DISubprogram(name: "test_noinline", scope: !1, file: !1, line: 12, unit: !0) +!13 = !DILocation(line: 13, scope: !12) +!14 = distinct !DISubprogram(name: "foo_inline1", scope: !1, file: !1, line: 11, unit: !0) +!15 = distinct !DISubprogram(name: "foo_inline_strip.suffix", scope: !1, file: !1, line: 1, unit: !0) +!16 = distinct !DISubprogram(name: "foo_inline_strip_conflict.suffix1", scope: !1, file: !1, line: 1, unit: !0) +!17 = distinct !DISubprogram(name: "foo_inline_strip_conflict.suffix2", scope: !1, file: !1, line: 1, unit: !0) +!18 = distinct !DISubprogram(name: "foo_inline_strip_conflict.suffix3", scope: !1, file: !1, line: 1, unit: !0) +!19 = distinct !DISubprogram(name: "foo_inline2", scope: !1, file: !1, line: 19, unit: !0) +!20 = distinct !DISubprogram(name: "foo_noinline", scope: !1, file: !1, line: 20, unit: !0) +!21 = distinct !DISubprogram(name: "foo_direct", scope: !1, file: !1, line: 21, unit: !0) +!22 = distinct !DISubprogram(name: "test_direct", scope: !1, file: !1, line: 22, unit: !0) +!23 = !DILocation(line: 23, scope: !22) |