llvm.org GIT mirror llvm / 0c69da8
[hot-cold-split] Name split functions with ".cold" suffix Summary: The current default of appending "_"+entry block label to the new extracted cold function breaks demangling. Change the deliminator from "_" to "." to enable demangling. Because the header block label will be empty for release compile code, use "extracted" after the "." when the label is empty. Additionally, add a mechanism for the client to pass in an alternate suffix applied after the ".", and have the hot cold split pass use "cold."+Count, where the Count is currently 1 but can be used to uniquely number multiple cold functions split out from the same function with D53588. Reviewers: sebpop, hiraditya Subscribers: llvm-commits, erik.pilkington Differential Revision: https://reviews.llvm.org/D53534 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345178 91177308-0d34-0410-b5e6-96231b3b80d8 Teresa Johnson 10 months ago
35 changed file(s) with 94 addition(s) and 79 deletion(s). Raw diff Collapse all Expand all
6363 unsigned NumExitBlocks = std::numeric_limits::max();
6464 Type *RetTy;
6565
66 // Suffix to use when creating extracted function (appended to the original
67 // function name + "."). If empty, the default is to use the entry block
68 // label, if non-empty, otherwise "extracted".
69 std::string Suffix;
70
6671 public:
6772 /// Create a code extractor for a sequence of blocks.
6873 ///
7782 CodeExtractor(ArrayRef BBs, DominatorTree *DT = nullptr,
7883 bool AggregateArgs = false, BlockFrequencyInfo *BFI = nullptr,
7984 BranchProbabilityInfo *BPI = nullptr,
80 bool AllowVarArgs = false, bool AllowAlloca = false);
85 bool AllowVarArgs = false, bool AllowAlloca = false,
86 std::string Suffix = "");
8187
8288 /// Create a code extractor for a loop body.
8389 ///
8591 /// block sequence of the loop.
8692 CodeExtractor(DominatorTree &DT, Loop &L, bool AggregateArgs = false,
8793 BlockFrequencyInfo *BFI = nullptr,
88 BranchProbabilityInfo *BPI = nullptr);
94 BranchProbabilityInfo *BPI = nullptr,
95 std::string Suffix = "");
8996
9097 /// Perform the extraction, returning the new function.
9198 ///
264264 DominatorTree *DT, PostDomTree *PDT);
265265 Function *extractColdRegion(const SmallVectorImpl &Region,
266266 DominatorTree *DT, BlockFrequencyInfo *BFI,
267 OptimizationRemarkEmitter &ORE);
267 OptimizationRemarkEmitter &ORE, unsigned Count);
268268 bool isOutlineCandidate(const SmallVectorImpl &Region,
269269 const BasicBlock *Exit) const {
270270 if (!Exit)
330330 return true;
331331 }
332332
333 Function *
334 HotColdSplitting::extractColdRegion(const SmallVectorImpl &Region,
335 DominatorTree *DT, BlockFrequencyInfo *BFI,
336 OptimizationRemarkEmitter &ORE) {
333 Function *HotColdSplitting::extractColdRegion(
334 const SmallVectorImpl &Region, DominatorTree *DT,
335 BlockFrequencyInfo *BFI, OptimizationRemarkEmitter &ORE, unsigned Count) {
337336 assert(!Region.empty());
338337 LLVM_DEBUG(for (auto *BB : Region)
339338 llvm::dbgs() << "\nExtracting: " << *BB;);
340339
341340 // TODO: Pass BFI and BPI to update profile information.
342 CodeExtractor CE(Region, DT);
341 CodeExtractor CE(Region, DT, /* AggregateArgs */ false, /* BFI */ nullptr,
342 /* BPI */ nullptr, /* AllowVarArgs */ false,
343 /* AllowAlloca */ false,
344 /* Suffix */ "cold." + std::to_string(Count));
343345
344346 SetVector Inputs, Outputs, Sinks;
345347 CE.findInputsOutputs(Inputs, Outputs, Sinks);
425427 ++NumColdSESEFound;
426428 ValidColdRegion.push_back(ExitColdRegion);
427429 // Candidate for outlining. FIXME: Continue outlining.
428 return extractColdRegion(ValidColdRegion, DT, BFI, ORE);
430 return extractColdRegion(ValidColdRegion, DT, BFI, ORE, /* Count */ 1);
429431 }
430432 }
431433 }
227227 CodeExtractor::CodeExtractor(ArrayRef BBs, DominatorTree *DT,
228228 bool AggregateArgs, BlockFrequencyInfo *BFI,
229229 BranchProbabilityInfo *BPI, bool AllowVarArgs,
230 bool AllowAlloca)
230 bool AllowAlloca, std::string Suffix)
231231 : DT(DT), AggregateArgs(AggregateArgs || AggregateArgsOpt), BFI(BFI),
232232 BPI(BPI), AllowVarArgs(AllowVarArgs),
233 Blocks(buildExtractionBlockSet(BBs, DT, AllowVarArgs, AllowAlloca)) {}
233 Blocks(buildExtractionBlockSet(BBs, DT, AllowVarArgs, AllowAlloca)),
234 Suffix(Suffix) {}
234235
235236 CodeExtractor::CodeExtractor(DominatorTree &DT, Loop &L, bool AggregateArgs,
236237 BlockFrequencyInfo *BFI,
237 BranchProbabilityInfo *BPI)
238 BranchProbabilityInfo *BPI, std::string Suffix)
238239 : DT(&DT), AggregateArgs(AggregateArgs || AggregateArgsOpt), BFI(BFI),
239240 BPI(BPI), AllowVarArgs(false),
240241 Blocks(buildExtractionBlockSet(L.getBlocks(), &DT,
241242 /* AllowVarArgs */ false,
242 /* AllowAlloca */ false)) {}
243 /* AllowAlloca */ false)),
244 Suffix(Suffix) {}
243245
244246 /// definedInRegion - Return true if the specified value is defined in the
245247 /// extracted region.
668670 FunctionType::get(RetTy, paramTy,
669671 AllowVarArgs && oldFunction->isVarArg());
670672
673 std::string SuffixToUse =
674 Suffix.empty()
675 ? (header->getName().empty() ? "extracted" : header->getName().str())
676 : Suffix;
671677 // Create the new function
672678 Function *newFunction = Function::Create(
673679 funcType, GlobalValue::InternalLinkage, oldFunction->getAddressSpace(),
674 oldFunction->getName() + "_" + header->getName(), M);
680 oldFunction->getName() + "." + SuffixToUse, M);
675681 // If the old function is no-throw, so is the new one.
676682 if (oldFunction->doesNotThrow())
677683 newFunction->setDoesNotThrow();
33 ; RUN: opt -S -extract-blocks -extract-blocks-file=%t -extract-blocks-erase-funcs %s | FileCheck %s --check-prefix=CHECK-ERASE
44
55 ; CHECK-NO-ERASE: @foo(
6 ; CHECK-NO-ERASE: @foo_bb9(
7 ; CHECK-NO-ERASE: @foo_bb20(
6 ; CHECK-NO-ERASE: @foo.bb9(
7 ; CHECK-NO-ERASE: @foo.bb20(
88 ; CHECK-ERASE: declare i32 @foo(
9 ; CHECK-ERASE: @foo_bb9(
10 ; CHECK-ERASE: @foo_bb20(
9 ; CHECK-ERASE: @foo.bb9(
10 ; CHECK-ERASE: @foo.bb20(
1111 define i32 @foo(i32 %arg, i32 %arg1) {
1212 bb:
1313 %tmp5 = icmp sgt i32 %arg, 0
2121 ret i32 %val
2222 }
2323
24 ; CHECK: @inlinedFunc.1_if.then(i1 %cond) !prof [[COUNT1:![0-9]+]]
24 ; CHECK: @inlinedFunc.1.if.then(i1 %cond) !prof [[COUNT1:![0-9]+]]
2525
2626
2727 !llvm.module.flags = !{!0}
4040 ; CHECK-LABEL: @dummy_caller
4141 ; CHECK: br i1
4242 ; CHECK: br i1
43 ; CHECK: call void @bar.1_
43 ; CHECK: call void @bar.1.
4444 ; LIMIT-LABEL: @dummy_caller
4545 ; LIMIT: br i1
4646 ; LIMIT-NOT: br
47 ; LIMIT: call void @bar.1_
47 ; LIMIT: call void @bar.1.
4848 %tmp = tail call i32 @bar(i32 %arg)
4949 ret i32 %tmp
5050 }
4848 ; CHECK: br i1
4949 ; CHECK: br i1
5050 ; CHECK: br i1
51 ; CHECK: call void @bar.1_
51 ; CHECK: call void @bar.1.
5252 ; LIMIT-LABEL: @dummy_caller
5353 ; LIMIT-NOT: br i1
5454 ; LIMIT: call i32 @bar
5454 ret i32 %add
5555 }
5656 ; CHECK-LABEL: @caller
57 ; CHECK: call void @callee_most.2_if.then(i32 %v
57 ; CHECK: call void @callee_most.2.if.then(i32 %v
5858 ; CHECK: call i32 @callee_noinline(i32 %v)
59 ; CHECK: call void @callee_writeonly.1_if.then(i32 %v
59 ; CHECK: call void @callee_writeonly.1.if.then(i32 %v
6060 define i32 @caller(i32 %v) {
6161 entry:
6262 %c1 = call i32 @callee_most(i32 %v)
6565 ret i32 %c3
6666 }
6767
68 ; CHECK: define internal void @callee_writeonly.1_if.then(i32 %v, i32* %sub.out) {
69 ; CHECK: define internal void @callee_most.2_if.then(i32 %v, i32* %sub.out) [[FN_ATTRS:#[0-9]+]]
68 ; CHECK: define internal void @callee_writeonly.1.if.then(i32 %v, i32* %sub.out) {
69 ; CHECK: define internal void @callee_most.2.if.then(i32 %v, i32* %sub.out) [[FN_ATTRS:#[0-9]+]]
7070
7171 ; attributes to preserve
7272 attributes #0 = {
2222
2323 ; CHECK-LABEL: @caller
2424 ; CHECK: codeRepl.i:
25 ; CHECK-NEXT: call void @callee.2_if.then(i32 %v, i32* %mul.loc.i), !dbg ![[DBG2:[0-9]+]]
25 ; CHECK-NEXT: call void @callee.2.if.then(i32 %v, i32* %mul.loc.i), !dbg ![[DBG2:[0-9]+]]
2626 define i32 @caller(i32 %v) !dbg !8 {
2727 entry:
2828 %call = call i32 @callee(i32 %v), !dbg !14
5252
5353 ; CHECK-LABEL: @caller2
5454 ; CHECK: codeRepl.i:
55 ; CHECK-NEXT: call void @callee2.1_if.then(i32 %v, i32* %sub.loc.i), !dbg ![[DBG4:[0-9]+]]
55 ; CHECK-NEXT: call void @callee2.1.if.then(i32 %v, i32* %sub.loc.i), !dbg ![[DBG4:[0-9]+]]
5656 define i32 @caller2(i32 %v) !dbg !21 {
5757 entry:
5858 %call = call i32 @callee2(i32 %v), !dbg !22
5959 ret i32 %call
6060 }
6161
62 ; CHECK-LABEL: define internal void @callee2.1_if.then
62 ; CHECK-LABEL: define internal void @callee2.1.if.then
6363 ; CHECK: br label %if.then, !dbg ![[DBG5:[0-9]+]]
6464
65 ; CHECK-LABEL: define internal void @callee.2_if.then
65 ; CHECK-LABEL: define internal void @callee.2.if.then
6666 ; CHECK: br label %if.then, !dbg ![[DBG6:[0-9]+]]
6767
6868 ; CHECK: ![[DBG1]] = !DILocation(line: 10, column: 7,
1616 entry:
1717 ; CHECK-LABEL: @Caller1
1818 ; CHECK: br
19 ; CHECK: call void @Func.1_
19 ; CHECK: call void @Func.1.
2020 ; CHECK: br
21 ; CHECK: call void @Func.1_
21 ; CHECK: call void @Func.1.
2222 %val = call i32 @Func(i1 %cond, i32* %align.val)
2323 %val2 = call i32 @Func(i1 %cond, i32* %align.val)
2424 ret i32 %val
2828 entry:
2929 ; CHECK-LABEL: @Caller2
3030 ; CHECK: br
31 ; CHECK: call void @Func.1_
31 ; CHECK: call void @Func.1.
3232 %val = call i32 @Func(i1 %cond, i32* %align.val)
3333 ret i32 %val
3434 }
2525 ; CHECK-LABEL: bb:
2626 ; CHECK-NEXT: [[CALL26LOC:%.*]] = alloca i8*
2727 ; CHECK-LABEL: codeRepl.i:
28 ; CHECK-NEXT: call void @bar.1_bb1(i8** [[CALL26LOC]])
28 ; CHECK-NEXT: call void @bar.1.bb1(i8** [[CALL26LOC]])
2929 define i8* @dummy_caller(i32 %arg) {
3030 bb:
3131 %tmp = tail call i8* @bar(i32 %arg)
3232 ret i8* %tmp
3333 }
3434
35 ; CHECK-LABEL: define internal void @bar.1_bb1
35 ; CHECK-LABEL: define internal void @bar.1.bb1
3636 ; CHECK-LABEL: bb1:
3737 ; CHECK-NEXT: %call26 = invoke i8* @invoke_callee()
3838 ; CHECK-NEXT: to label %cont unwind label %lpad
3535 define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 {
3636 ; CHECK-LABEL: @dummy_caller
3737 ; CHECK: codeRepl.i:
38 ; CHECK: call void @test.1_bb2()
38 ; CHECK: call void @test.1.bb2()
3939 ; CHECK-NOT: load
4040 ; CHECK br
4141
4444 ret i32 %tmp
4545 }
4646
47 ; CHECK-LABEL: define internal void @test.1_bb2()
47 ; CHECK-LABEL: define internal void @test.1.bb2()
4848 ; CHECK: .exitStub:
4949 ; CHECK-NOT: store i32 %tmp7, i32* %tmp7.out
5050 ; CHECK: ret
3838 define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 {
3939 ; CHECK-LABEL: @dummy_caller
4040 ; CHECK: codeRepl.i:
41 ; CHECK: call void @test.1_bb2()
41 ; CHECK: call void @test.1.bb2()
4242 ; CHECK-NOT: load
4343 ; CHECK br
4444 bb:
4646 ret i32 %tmp
4747 }
4848
49 ; CHECK-LABEL: define internal void @test.1_bb2()
49 ; CHECK-LABEL: define internal void @test.1.bb2()
5050 ; CHECK: .exitStub:
5151 ; CHECK-NOT: store i32 %tmp7, i32* %tmp7.out
5252 ; CHECK: ret
4040 ; CHECK-LABEL: @dummy_caller
4141 ; CHECK: br i1
4242 ; CHECK: br i1
43 ; CHECK: call void @bar.2_
43 ; CHECK: call void @bar.2.
4444 ; LIMIT-LABEL: @dummy_caller
4545 ; LIMIT-NOT: br
4646 ; LIMIT: call i32 @bar(
8383 define i32 @dummy_caller2(i32 %arg) local_unnamed_addr #0 {
8484 ; CHECK: br i1
8585 ; CHECK: br i1
86 ; CHECK: call {{.*}} @bar_multi_ret.1_
86 ; CHECK: call {{.*}} @bar_multi_ret.1.
8787 %tmp = tail call i32 @bar_multi_ret(i32 %arg)
8888 ret i32 %tmp
8989 }
5151 ; CHECK: br i1
5252 ; CHECK: br i1
5353 ; CHECK: br i1
54 ; CHECK: call void @bar.1_
54 ; CHECK: call void @bar.1.
5555 ; LIMIT3-LABEL: @dummy_caller
5656 ; LIMIT3: br i1
5757 ; LIMIT3: br i1
5858 ; LIMIT3-NOT: br i1
59 ; LIMIT3: call void @bar.1_
59 ; LIMIT3: call void @bar.1.
6060 ; LIMIT2-LABEL: @dummy_caller
6161 ; LIMIT2-NOT: br i1
6262 ; LIMIT2: call i32 @bar(
108108 ; CHECK-LABEL: @foo
109109 ; CHECK-NOT: call signext i32 @bar
110110 ; CHECK: codeRepl1.i:
111 ; CHECK: call void @bar.1_if.then
111 ; CHECK: call void @bar.1.if.then
112112 ; CHECK: codeRepl.i:
113 ; CHECK: call void @bar.1_if.then2
113 ; CHECK: call void @bar.1.if.then2
114114 entry:
115115 %value.addr = alloca i32, align 4
116116 %ub.addr = alloca i32, align 4
122122 ret i32 %call
123123 }
124124
125 ; CHECK-LABEL: define internal void @bar.1_if.then2
125 ; CHECK-LABEL: define internal void @bar.1.if.then2
126126 ; CHECK: .exitStub:
127127 ; CHECK: ret void
128128
129 ; CHECK-LABEL: define internal void @bar.1_if.then
129 ; CHECK-LABEL: define internal void @bar.1.if.then
130130 ; CHECK: .exitStub:
131131 ; CHECK: ret void
132132
6565 ; CHECK-LABEL: @foo
6666 ; CHECK: codeRepl.i:
6767 ; CHECK-NOT: call signext i32 @bar
68 ; CHECK: call void @bar.1_if.then
68 ; CHECK: call void @bar.1.if.then
6969 entry:
7070 %value.addr = alloca i32, align 4
7171 %ub.addr = alloca i32, align 4
7777 ret i32 %call
7878 }
7979
80 ; CHECK-LABEL: define internal void @bar.1_if.then
80 ; CHECK-LABEL: define internal void @bar.1.if.then
8181 ; CHECK: .exitStub:
8282 ; CHECK: ret void
8383
3535 }
3636 ; CHECK-LABEL: @caller1
3737 ; CHECK: codeRepl.i:
38 ; CHECK-NEXT: call void (i32, i8**, i32, ...) @vararg.3_bb1(i32 %stat1.i, i8** %vargs.i, i32 %arg)
38 ; CHECK-NEXT: call void (i32, i8**, i32, ...) @vararg.3.bb1(i32 %stat1.i, i8** %vargs.i, i32 %arg)
3939
4040 define i32 @caller2(i32 %arg, float %arg2) {
4141 bb:
4545
4646 ; CHECK-LABEL: @caller2
4747 ; CHECK: codeRepl.i:
48 ; CHECK-NEXT: call void (i32, i8**, i32, ...) @vararg.3_bb1(i32 %stat1.i, i8** %vargs.i, i32 %arg, i32 10, float %arg2)
48 ; CHECK-NEXT: call void (i32, i8**, i32, ...) @vararg.3.bb1(i32 %stat1.i, i8** %vargs.i, i32 %arg, i32 10, float %arg2)
4949
5050 ; Test case to check that we do not extract a vararg function, if va_end is in
5151 ; a block that is not outlined.
103103
104104 ; CHECK-LABEL: @caller_with_signext
105105 ; CHECK: codeRepl.i:
106 ; CHECK-NEXT: call void (i32*, ...) @vararg2.1_cond.end(i32* %foo, i32 signext 8)
106 ; CHECK-NEXT: call void (i32*, ...) @vararg2.1.cond.end(i32* %foo, i32 signext 8)
1818
1919 ; CHECK-LABEL: @caller
2020 ; CHECK: codeRepl.i:
21 ; CHECK-NEXT: call void (i32, i32*, ...) @callee.1_if.then(i32 %v, i32* %mul.loc.i, i32 99), !dbg ![[DBG2:[0-9]+]]
21 ; CHECK-NEXT: call void (i32, i32*, ...) @callee.1.if.then(i32 %v, i32* %mul.loc.i, i32 99), !dbg ![[DBG2:[0-9]+]]
2222 define i32 @caller(i32 %v) !dbg !8 {
2323 entry:
2424 %call = call i32 (i32, ...) @callee(i32 %v, i32 99), !dbg !14
2525 ret i32 %call, !dbg !15
2626 }
2727
28 ; CHECK-LABEL: define internal void @callee.1_if.then
28 ; CHECK-LABEL: define internal void @callee.1.if.then
2929 ; CHECK: br label %if.then, !dbg ![[DBG3:[0-9]+]]
3030
3131 ; CHECK: ![[DBG1]] = !DILocation(line: 10, column: 7,
1515 entry:
1616 ; CHECK-LABEL: @dummyCaller
1717 ; CHECK: br
18 ; CHECK: call void @inlinedFunc.1_
18 ; CHECK: call void @inlinedFunc.1.
1919 %val = call i32 @inlinedFunc(i1 %cond, i32* %align.val)
2020 ret i32 %val
2121 }
3535 attributes #0 = { nounwind readnone }
3636 attributes #1 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+sse4.1" }
3737
38 ; CHECK: define {{.*}} @inlinedFunc.1_if.then{{.*}} [[COUNT1:#[0-9]+]]
38 ; CHECK: define {{.*}} @inlinedFunc.1.if.then{{.*}} [[COUNT1:#[0-9]+]]
3939 ; CHECK: [[COUNT1]] = { {{.*}} "target-cpu"="x86-64" "target-features"="+sse4.1" }
4646 define i32 @dummy_caller(i32* %arg) local_unnamed_addr {
4747 ; CHECK-LABEL: @dummy_caller
4848 %tmp = call i32 @outline_region_notlikely(i32* %arg)
49 ; CHECK: call void @outline_region_notlikely.2_bb1
49 ; CHECK: call void @outline_region_notlikely.2.bb1
5050 %tmp2 = tail call i32 @outline_region_likely(i32* %arg)
5151 ; CHECK: %tmp2 = tail call i32 @outline_region_likely(i32* %arg)
5252 ret i32 %tmp
5353
5454 }
5555
56 ; CHECK-LABEL: define internal void @outline_region_notlikely.2_bb1(i32* %arg) {
56 ; CHECK-LABEL: define internal void @outline_region_notlikely.2.bb1(i32* %arg) {
5757 ; CHECK-NEXT: newFuncRoot:
5858
5959 !llvm.module.flags = !{!0}
2727 }
2828
2929
30 ; CHECK-LABEL: define internal void @outline_region_notlikely.1_bb1(i32* %arg) {
30 ; CHECK-LABEL: define internal void @outline_region_notlikely.1.bb1(i32* %arg) {
3131 ; CHECK-NEXT: newFuncRoot:
3232
3333 declare i32 @foo(i32 * %arg)
4141 ; CHECK: entry:
4242 ; CHECK-NEXT: br i1
4343 ; CHECK: codeRepl.i:
44 ; CHECK-NEXT: call void @callee.1_{{.*}}()
44 ; CHECK-NEXT: call void @callee.1.{{.*}}()
4545 call void @callee(i1 %cond)
4646 ret void
4747 }
4848
49 ; CHECK-LABEL: define {{.*}} @callee.1_{{.*}}() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
49 ; CHECK-LABEL: define {{.*}} @callee.1.{{.*}}() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
5050 ; CHECK: invoke void @bar()
5151 ; CHECK: landingpad
4141 ; CHECK: entry:
4242 ; CHECK-NEXT: br i1
4343 ; CHECK: codeRepl.i:
44 ; CHECK-NEXT: call void @callee.1_{{.*}}()
44 ; CHECK-NEXT: call void @callee.1.{{.*}}()
4545 call void @callee(i1 %cond)
4646 ret void
4747 }
4848
49 ; CHECK-LABEL: define {{.*}} @callee.1_{{.*}}() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
49 ; CHECK-LABEL: define {{.*}} @callee.1.{{.*}}() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
5050 ; CHECK: invoke void @bar()
5151 ; CHECK: cleanuppad
5252 ; CHECK-NEXT: cleanupret
4040 ; CHECK-NOT: llvm.lifetime
4141 ; CHECK: br i1
4242 ; CHECK: codeRepl.i:
43 ; CHECK: call void @_Z3foov.1_
43 ; CHECK: call void @_Z3foov.1.
4444
4545 tail call void @_Z3foov()
4646 ret void
4747 }
4848
49 ; CHECK-LABEL: define internal void @_Z3foov.1_
49 ; CHECK-LABEL: define internal void @_Z3foov.1.
5050 ; CHECK: newFuncRoot:
5151 ; CHECK-NEXT: %tmp = alloca %class.A
5252 ; CHECK-NEXT: %tmp1 = bitcast %class.A* %tmp to i8*
4141 ; CHECK-NOT: llvm.lifetime
4242 ; CHECK: br i1
4343 ; CHECK: codeRepl.i:
44 ; CHECK: call void @_Z3foov.1_
44 ; CHECK: call void @_Z3foov.1.
4545 tail call void @_Z3foov()
4646 ret void
4747 }
4848
49 ; CHECK-LABEL: define internal void @_Z3foov.1_
49 ; CHECK-LABEL: define internal void @_Z3foov.1.
5050 ; CHECK: newFuncRoot:
5151 ; CHECK-NEXT: %tmp = alloca %class.A
5252 ; CHECK-NEXT: %tmp1 = getelementptr
4949 ret void
5050 }
5151
52 ; CHECK-LABEL: define internal void @_Z3foov.1_
52 ; CHECK-LABEL: define internal void @_Z3foov.1.
5353 ; CHECK: bb9:
5454 ; CHECK: call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %tmp1)
5555 ; CHECK: br label %.exitStub
4141 ret void
4242 }
4343
44 ; CHECK-LABEL: define internal void @_Z3foov.1_
44 ; CHECK-LABEL: define internal void @_Z3foov.1.
4545 ; CHECK: newFuncRoot:
4646 ; CHECK-NEXT: alloca
4747 ; CHECK-NEXT: bitcast
0 ; RUN: opt -S -partial-inliner %s | FileCheck %s
11
22 ; CHECK-LABEL: define void @dipsy(
3 ; CHECK-NEXT: call void @tinkywinky.1_ontrue()
3 ; CHECK-NEXT: call void @tinkywinky.1.ontrue()
44 ; CHECK-NEXT: call void @patatuccio()
55 ; CHECK-NEXT: ret void
66 ; CHECK-NEXT: }
77
8 ; CHECK-LABEL: define internal void @tinkywinky.1_ontrue() {
8 ; CHECK-LABEL: define internal void @tinkywinky.1.ontrue() {
99 ; CHECK-NEXT: newFuncRoot:
1010 ; CHECK-NEXT: br label %ontrue
1111 ; CHECK: onfalse{{.*}}:
11
22 ; CHECK-LABEL: @fun
33 ; CHECK: codeRepl:
4 ; CHECK-NEXT: call void @fun_if.else
4 ; CHECK-NEXT: call void @fun.cold.1
55
66 define void @fun() {
77 entry:
2727 unreachable
2828 }
2929
30 ; CHECK: define {{.*}} @fun_if.else{{.*}}#[[outlined_func_attr:[0-9]+]]
30 ; CHECK: define {{.*}} @fun.cold.1{{.*}}#[[outlined_func_attr:[0-9]+]]
3131 ; CHECK: attributes #[[outlined_func_attr]] = { {{.*}}minsize
33 ; Make sure this compiles. This test used to fail with an invalid phi node: the
44 ; two predecessors were outlined and the SSA representation was invalid.
55
6 ; CHECK: remark: :0:0: fun split cold code into fun_if.else
6 ; CHECK: remark: :0:0: fun split cold code into fun.cold.1
77 ; CHECK-LABEL: @fun
88 ; CHECK: codeRepl:
9 ; CHECK-NEXT: call void @fun_if.else
9 ; CHECK-NEXT: call void @fun.cold.1
1010
1111 define void @fun() {
1212 entry:
0 ; RUN: opt -hotcoldsplit -S < %s | FileCheck %s
11
2 ; CHECK-LABEL: define {{.*}}@foo_if.end
2 ; CHECK-LABEL: define {{.*}}@foo.cold
33 ; CHECK-NOT: llvm.dbg.value
44
55 define void @foo(i32 %arg1) !dbg !6 {
1111 ret void
1212 }
1313
14 ; CHECK: @foo_bb4
14 ; CHECK: @foo.bb4
1515 ; CHECK: call void @bar()
1616 ; CHECK: %tmp5
1717 define i32 @foo(i32 %arg) {
0 ; RUN: llvm-extract -S -bb foo:bb4 -bb foo:bb7 %s | FileCheck %s
11
2 ; CHECK: @foo_bb4
3 ; CHECK: @foo_bb7
2 ; CHECK: @foo.bb4
3 ; CHECK: @foo.bb7
44 define i32 @foo(i32 %arg) {
55 bb:
66 %tmp = alloca i32, align 4