forked from OSchip/llvm-project
[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 llvm-svn: 345178
This commit is contained in:
parent
b40e0520e1
commit
c8dba682bb
|
@ -64,6 +64,11 @@ class Value;
|
|||
unsigned NumExitBlocks = std::numeric_limits<unsigned>::max();
|
||||
Type *RetTy;
|
||||
|
||||
// Suffix to use when creating extracted function (appended to the original
|
||||
// function name + "."). If empty, the default is to use the entry block
|
||||
// label, if non-empty, otherwise "extracted".
|
||||
std::string Suffix;
|
||||
|
||||
public:
|
||||
/// Create a code extractor for a sequence of blocks.
|
||||
///
|
||||
|
@ -78,7 +83,8 @@ class Value;
|
|||
CodeExtractor(ArrayRef<BasicBlock *> BBs, DominatorTree *DT = nullptr,
|
||||
bool AggregateArgs = false, BlockFrequencyInfo *BFI = nullptr,
|
||||
BranchProbabilityInfo *BPI = nullptr,
|
||||
bool AllowVarArgs = false, bool AllowAlloca = false);
|
||||
bool AllowVarArgs = false, bool AllowAlloca = false,
|
||||
std::string Suffix = "");
|
||||
|
||||
/// Create a code extractor for a loop body.
|
||||
///
|
||||
|
@ -86,7 +92,8 @@ class Value;
|
|||
/// block sequence of the loop.
|
||||
CodeExtractor(DominatorTree &DT, Loop &L, bool AggregateArgs = false,
|
||||
BlockFrequencyInfo *BFI = nullptr,
|
||||
BranchProbabilityInfo *BPI = nullptr);
|
||||
BranchProbabilityInfo *BPI = nullptr,
|
||||
std::string Suffix = "");
|
||||
|
||||
/// Perform the extraction, returning the new function.
|
||||
///
|
||||
|
|
|
@ -265,7 +265,7 @@ private:
|
|||
DominatorTree *DT, PostDomTree *PDT);
|
||||
Function *extractColdRegion(const SmallVectorImpl<BasicBlock *> &Region,
|
||||
DominatorTree *DT, BlockFrequencyInfo *BFI,
|
||||
OptimizationRemarkEmitter &ORE);
|
||||
OptimizationRemarkEmitter &ORE, unsigned Count);
|
||||
bool isOutlineCandidate(const SmallVectorImpl<BasicBlock *> &Region,
|
||||
const BasicBlock *Exit) const {
|
||||
if (!Exit)
|
||||
|
@ -331,16 +331,18 @@ bool HotColdSplitting::shouldOutlineFrom(const Function &F) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
Function *
|
||||
HotColdSplitting::extractColdRegion(const SmallVectorImpl<BasicBlock *> &Region,
|
||||
DominatorTree *DT, BlockFrequencyInfo *BFI,
|
||||
OptimizationRemarkEmitter &ORE) {
|
||||
Function *HotColdSplitting::extractColdRegion(
|
||||
const SmallVectorImpl<BasicBlock *> &Region, DominatorTree *DT,
|
||||
BlockFrequencyInfo *BFI, OptimizationRemarkEmitter &ORE, unsigned Count) {
|
||||
assert(!Region.empty());
|
||||
LLVM_DEBUG(for (auto *BB : Region)
|
||||
llvm::dbgs() << "\nExtracting: " << *BB;);
|
||||
|
||||
// TODO: Pass BFI and BPI to update profile information.
|
||||
CodeExtractor CE(Region, DT);
|
||||
CodeExtractor CE(Region, DT, /* AggregateArgs */ false, /* BFI */ nullptr,
|
||||
/* BPI */ nullptr, /* AllowVarArgs */ false,
|
||||
/* AllowAlloca */ false,
|
||||
/* Suffix */ "cold." + std::to_string(Count));
|
||||
|
||||
SetVector<Value *> Inputs, Outputs, Sinks;
|
||||
CE.findInputsOutputs(Inputs, Outputs, Sinks);
|
||||
|
@ -426,7 +428,7 @@ const Function *HotColdSplitting::outlineColdBlocks(Function &F,
|
|||
++NumColdSESEFound;
|
||||
ValidColdRegion.push_back(ExitColdRegion);
|
||||
// Candidate for outlining. FIXME: Continue outlining.
|
||||
return extractColdRegion(ValidColdRegion, DT, BFI, ORE);
|
||||
return extractColdRegion(ValidColdRegion, DT, BFI, ORE, /* Count */ 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -228,19 +228,21 @@ buildExtractionBlockSet(ArrayRef<BasicBlock *> BBs, DominatorTree *DT,
|
|||
CodeExtractor::CodeExtractor(ArrayRef<BasicBlock *> BBs, DominatorTree *DT,
|
||||
bool AggregateArgs, BlockFrequencyInfo *BFI,
|
||||
BranchProbabilityInfo *BPI, bool AllowVarArgs,
|
||||
bool AllowAlloca)
|
||||
bool AllowAlloca, std::string Suffix)
|
||||
: DT(DT), AggregateArgs(AggregateArgs || AggregateArgsOpt), BFI(BFI),
|
||||
BPI(BPI), AllowVarArgs(AllowVarArgs),
|
||||
Blocks(buildExtractionBlockSet(BBs, DT, AllowVarArgs, AllowAlloca)) {}
|
||||
Blocks(buildExtractionBlockSet(BBs, DT, AllowVarArgs, AllowAlloca)),
|
||||
Suffix(Suffix) {}
|
||||
|
||||
CodeExtractor::CodeExtractor(DominatorTree &DT, Loop &L, bool AggregateArgs,
|
||||
BlockFrequencyInfo *BFI,
|
||||
BranchProbabilityInfo *BPI)
|
||||
BranchProbabilityInfo *BPI, std::string Suffix)
|
||||
: DT(&DT), AggregateArgs(AggregateArgs || AggregateArgsOpt), BFI(BFI),
|
||||
BPI(BPI), AllowVarArgs(false),
|
||||
Blocks(buildExtractionBlockSet(L.getBlocks(), &DT,
|
||||
/* AllowVarArgs */ false,
|
||||
/* AllowAlloca */ false)) {}
|
||||
/* AllowAlloca */ false)),
|
||||
Suffix(Suffix) {}
|
||||
|
||||
/// definedInRegion - Return true if the specified value is defined in the
|
||||
/// extracted region.
|
||||
|
@ -669,10 +671,14 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs,
|
|||
FunctionType::get(RetTy, paramTy,
|
||||
AllowVarArgs && oldFunction->isVarArg());
|
||||
|
||||
std::string SuffixToUse =
|
||||
Suffix.empty()
|
||||
? (header->getName().empty() ? "extracted" : header->getName().str())
|
||||
: Suffix;
|
||||
// Create the new function
|
||||
Function *newFunction = Function::Create(
|
||||
funcType, GlobalValue::InternalLinkage, oldFunction->getAddressSpace(),
|
||||
oldFunction->getName() + "_" + header->getName(), M);
|
||||
oldFunction->getName() + "." + SuffixToUse, M);
|
||||
// If the old function is no-throw, so is the new one.
|
||||
if (oldFunction->doesNotThrow())
|
||||
newFunction->setDoesNotThrow();
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
; RUN: opt -S -extract-blocks -extract-blocks-file=%t -extract-blocks-erase-funcs %s | FileCheck %s --check-prefix=CHECK-ERASE
|
||||
|
||||
; CHECK-NO-ERASE: @foo(
|
||||
; CHECK-NO-ERASE: @foo_bb9(
|
||||
; CHECK-NO-ERASE: @foo_bb20(
|
||||
; CHECK-NO-ERASE: @foo.bb9(
|
||||
; CHECK-NO-ERASE: @foo.bb20(
|
||||
; CHECK-ERASE: declare i32 @foo(
|
||||
; CHECK-ERASE: @foo_bb9(
|
||||
; CHECK-ERASE: @foo_bb20(
|
||||
; CHECK-ERASE: @foo.bb9(
|
||||
; CHECK-ERASE: @foo.bb20(
|
||||
define i32 @foo(i32 %arg, i32 %arg1) {
|
||||
bb:
|
||||
%tmp5 = icmp sgt i32 %arg, 0
|
||||
|
|
|
@ -22,7 +22,7 @@ entry:
|
|||
ret i32 %val
|
||||
}
|
||||
|
||||
; CHECK: @inlinedFunc.1_if.then(i1 %cond) !prof [[COUNT1:![0-9]+]]
|
||||
; CHECK: @inlinedFunc.1.if.then(i1 %cond) !prof [[COUNT1:![0-9]+]]
|
||||
|
||||
|
||||
!llvm.module.flags = !{!0}
|
||||
|
|
|
@ -41,11 +41,11 @@ bb:
|
|||
; CHECK-LABEL: @dummy_caller
|
||||
; CHECK: br i1
|
||||
; CHECK: br i1
|
||||
; CHECK: call void @bar.1_
|
||||
; CHECK: call void @bar.1.
|
||||
; LIMIT-LABEL: @dummy_caller
|
||||
; LIMIT: br i1
|
||||
; LIMIT-NOT: br
|
||||
; LIMIT: call void @bar.1_
|
||||
; LIMIT: call void @bar.1.
|
||||
%tmp = tail call i32 @bar(i32 %arg)
|
||||
ret i32 %tmp
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ bb:
|
|||
; CHECK: br i1
|
||||
; CHECK: br i1
|
||||
; CHECK: br i1
|
||||
; CHECK: call void @bar.1_
|
||||
; CHECK: call void @bar.1.
|
||||
; LIMIT-LABEL: @dummy_caller
|
||||
; LIMIT-NOT: br i1
|
||||
; LIMIT: call i32 @bar
|
||||
|
|
|
@ -55,9 +55,9 @@ if.end:
|
|||
ret i32 %add
|
||||
}
|
||||
; CHECK-LABEL: @caller
|
||||
; CHECK: call void @callee_most.2_if.then(i32 %v
|
||||
; CHECK: call void @callee_most.2.if.then(i32 %v
|
||||
; CHECK: call i32 @callee_noinline(i32 %v)
|
||||
; CHECK: call void @callee_writeonly.1_if.then(i32 %v
|
||||
; CHECK: call void @callee_writeonly.1.if.then(i32 %v
|
||||
define i32 @caller(i32 %v) {
|
||||
entry:
|
||||
%c1 = call i32 @callee_most(i32 %v)
|
||||
|
@ -66,8 +66,8 @@ entry:
|
|||
ret i32 %c3
|
||||
}
|
||||
|
||||
; CHECK: define internal void @callee_writeonly.1_if.then(i32 %v, i32* %sub.out) {
|
||||
; CHECK: define internal void @callee_most.2_if.then(i32 %v, i32* %sub.out) [[FN_ATTRS:#[0-9]+]]
|
||||
; CHECK: define internal void @callee_writeonly.1.if.then(i32 %v, i32* %sub.out) {
|
||||
; CHECK: define internal void @callee_most.2.if.then(i32 %v, i32* %sub.out) [[FN_ATTRS:#[0-9]+]]
|
||||
|
||||
; attributes to preserve
|
||||
attributes #0 = {
|
||||
|
|
|
@ -23,7 +23,7 @@ if.end: ; preds = %if.then, %entry
|
|||
|
||||
; CHECK-LABEL: @caller
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK-NEXT: call void @callee.2_if.then(i32 %v, i32* %mul.loc.i), !dbg ![[DBG2:[0-9]+]]
|
||||
; CHECK-NEXT: call void @callee.2.if.then(i32 %v, i32* %mul.loc.i), !dbg ![[DBG2:[0-9]+]]
|
||||
define i32 @caller(i32 %v) !dbg !8 {
|
||||
entry:
|
||||
%call = call i32 @callee(i32 %v), !dbg !14
|
||||
|
@ -53,17 +53,17 @@ if.end:
|
|||
|
||||
; CHECK-LABEL: @caller2
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK-NEXT: call void @callee2.1_if.then(i32 %v, i32* %sub.loc.i), !dbg ![[DBG4:[0-9]+]]
|
||||
; CHECK-NEXT: call void @callee2.1.if.then(i32 %v, i32* %sub.loc.i), !dbg ![[DBG4:[0-9]+]]
|
||||
define i32 @caller2(i32 %v) !dbg !21 {
|
||||
entry:
|
||||
%call = call i32 @callee2(i32 %v), !dbg !22
|
||||
ret i32 %call
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @callee2.1_if.then
|
||||
; CHECK-LABEL: define internal void @callee2.1.if.then
|
||||
; CHECK: br label %if.then, !dbg ![[DBG5:[0-9]+]]
|
||||
|
||||
; CHECK-LABEL: define internal void @callee.2_if.then
|
||||
; CHECK-LABEL: define internal void @callee.2.if.then
|
||||
; CHECK: br label %if.then, !dbg ![[DBG6:[0-9]+]]
|
||||
|
||||
; CHECK: ![[DBG1]] = !DILocation(line: 10, column: 7,
|
||||
|
|
|
@ -17,9 +17,9 @@ define internal i32 @Caller1(i1 %cond, i32* align 2 %align.val) !prof !3{
|
|||
entry:
|
||||
; CHECK-LABEL: @Caller1
|
||||
; CHECK: br
|
||||
; CHECK: call void @Func.1_
|
||||
; CHECK: call void @Func.1.
|
||||
; CHECK: br
|
||||
; CHECK: call void @Func.1_
|
||||
; CHECK: call void @Func.1.
|
||||
%val = call i32 @Func(i1 %cond, i32* %align.val)
|
||||
%val2 = call i32 @Func(i1 %cond, i32* %align.val)
|
||||
ret i32 %val
|
||||
|
@ -29,7 +29,7 @@ define internal i32 @Caller2(i1 %cond, i32* align 2 %align.val) !prof !2{
|
|||
entry:
|
||||
; CHECK-LABEL: @Caller2
|
||||
; CHECK: br
|
||||
; CHECK: call void @Func.1_
|
||||
; CHECK: call void @Func.1.
|
||||
%val = call i32 @Func(i1 %cond, i32* %align.val)
|
||||
ret i32 %val
|
||||
}
|
||||
|
|
|
@ -26,14 +26,14 @@ bb5: ; preds = %bb4, %bb1, %bb
|
|||
; CHECK-LABEL: bb:
|
||||
; CHECK-NEXT: [[CALL26LOC:%.*]] = alloca i8*
|
||||
; CHECK-LABEL: codeRepl.i:
|
||||
; CHECK-NEXT: call void @bar.1_bb1(i8** [[CALL26LOC]])
|
||||
; CHECK-NEXT: call void @bar.1.bb1(i8** [[CALL26LOC]])
|
||||
define i8* @dummy_caller(i32 %arg) {
|
||||
bb:
|
||||
%tmp = tail call i8* @bar(i32 %arg)
|
||||
ret i8* %tmp
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @bar.1_bb1
|
||||
; CHECK-LABEL: define internal void @bar.1.bb1
|
||||
; CHECK-LABEL: bb1:
|
||||
; CHECK-NEXT: %call26 = invoke i8* @invoke_callee()
|
||||
; CHECK-NEXT: to label %cont unwind label %lpad
|
||||
|
|
|
@ -36,7 +36,7 @@ declare void @foo(...) local_unnamed_addr #1
|
|||
define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 {
|
||||
; CHECK-LABEL: @dummy_caller
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK: call void @test.1_bb2()
|
||||
; CHECK: call void @test.1.bb2()
|
||||
; CHECK-NOT: load
|
||||
; CHECK br
|
||||
|
||||
|
@ -45,7 +45,7 @@ bb:
|
|||
ret i32 %tmp
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @test.1_bb2()
|
||||
; CHECK-LABEL: define internal void @test.1.bb2()
|
||||
; CHECK: .exitStub:
|
||||
; CHECK-NOT: store i32 %tmp7, i32* %tmp7.out
|
||||
; CHECK: ret
|
||||
|
|
|
@ -39,7 +39,7 @@ declare void @foo(...) local_unnamed_addr #0
|
|||
define i32 @dummy_caller(i32 %arg) local_unnamed_addr #0 {
|
||||
; CHECK-LABEL: @dummy_caller
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK: call void @test.1_bb2()
|
||||
; CHECK: call void @test.1.bb2()
|
||||
; CHECK-NOT: load
|
||||
; CHECK br
|
||||
bb:
|
||||
|
@ -47,7 +47,7 @@ bb:
|
|||
ret i32 %tmp
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @test.1_bb2()
|
||||
; CHECK-LABEL: define internal void @test.1.bb2()
|
||||
; CHECK: .exitStub:
|
||||
; CHECK-NOT: store i32 %tmp7, i32* %tmp7.out
|
||||
; CHECK: ret
|
||||
|
|
|
@ -41,7 +41,7 @@ bb:
|
|||
; CHECK-LABEL: @dummy_caller
|
||||
; CHECK: br i1
|
||||
; CHECK: br i1
|
||||
; CHECK: call void @bar.2_
|
||||
; CHECK: call void @bar.2.
|
||||
; LIMIT-LABEL: @dummy_caller
|
||||
; LIMIT-NOT: br
|
||||
; LIMIT: call i32 @bar(
|
||||
|
@ -84,7 +84,7 @@ bb5: ; preds = %bb4, %bb1
|
|||
define i32 @dummy_caller2(i32 %arg) local_unnamed_addr #0 {
|
||||
; CHECK: br i1
|
||||
; CHECK: br i1
|
||||
; CHECK: call {{.*}} @bar_multi_ret.1_
|
||||
; CHECK: call {{.*}} @bar_multi_ret.1.
|
||||
%tmp = tail call i32 @bar_multi_ret(i32 %arg)
|
||||
ret i32 %tmp
|
||||
}
|
||||
|
|
|
@ -52,12 +52,12 @@ bb:
|
|||
; CHECK: br i1
|
||||
; CHECK: br i1
|
||||
; CHECK: br i1
|
||||
; CHECK: call void @bar.1_
|
||||
; CHECK: call void @bar.1.
|
||||
; LIMIT3-LABEL: @dummy_caller
|
||||
; LIMIT3: br i1
|
||||
; LIMIT3: br i1
|
||||
; LIMIT3-NOT: br i1
|
||||
; LIMIT3: call void @bar.1_
|
||||
; LIMIT3: call void @bar.1.
|
||||
; LIMIT2-LABEL: @dummy_caller
|
||||
; LIMIT2-NOT: br i1
|
||||
; LIMIT2: call i32 @bar(
|
||||
|
|
|
@ -109,9 +109,9 @@ define signext i32 @foo(i32 signext %value, i32 signext %ub) #0 !prof !30 {
|
|||
; CHECK-LABEL: @foo
|
||||
; CHECK-NOT: call signext i32 @bar
|
||||
; CHECK: codeRepl1.i:
|
||||
; CHECK: call void @bar.1_if.then
|
||||
; CHECK: call void @bar.1.if.then
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK: call void @bar.1_if.then2
|
||||
; CHECK: call void @bar.1.if.then2
|
||||
entry:
|
||||
%value.addr = alloca i32, align 4
|
||||
%ub.addr = alloca i32, align 4
|
||||
|
@ -123,11 +123,11 @@ entry:
|
|||
ret i32 %call
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @bar.1_if.then2
|
||||
; CHECK-LABEL: define internal void @bar.1.if.then2
|
||||
; CHECK: .exitStub:
|
||||
; CHECK: ret void
|
||||
|
||||
; CHECK-LABEL: define internal void @bar.1_if.then
|
||||
; CHECK-LABEL: define internal void @bar.1.if.then
|
||||
; CHECK: .exitStub:
|
||||
; CHECK: ret void
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ define signext i32 @foo(i32 signext %value, i32 signext %ub) #0 !prof !30 {
|
|||
; CHECK-LABEL: @foo
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK-NOT: call signext i32 @bar
|
||||
; CHECK: call void @bar.1_if.then
|
||||
; CHECK: call void @bar.1.if.then
|
||||
entry:
|
||||
%value.addr = alloca i32, align 4
|
||||
%ub.addr = alloca i32, align 4
|
||||
|
@ -78,7 +78,7 @@ entry:
|
|||
ret i32 %call
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @bar.1_if.then
|
||||
; CHECK-LABEL: define internal void @bar.1.if.then
|
||||
; CHECK: .exitStub:
|
||||
; CHECK: ret void
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ bb:
|
|||
}
|
||||
; CHECK-LABEL: @caller1
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK-NEXT: call void (i32, i8**, i32, ...) @vararg.3_bb1(i32 %stat1.i, i8** %vargs.i, i32 %arg)
|
||||
; CHECK-NEXT: call void (i32, i8**, i32, ...) @vararg.3.bb1(i32 %stat1.i, i8** %vargs.i, i32 %arg)
|
||||
|
||||
define i32 @caller2(i32 %arg, float %arg2) {
|
||||
bb:
|
||||
|
@ -46,7 +46,7 @@ bb:
|
|||
|
||||
; CHECK-LABEL: @caller2
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK-NEXT: call void (i32, i8**, i32, ...) @vararg.3_bb1(i32 %stat1.i, i8** %vargs.i, i32 %arg, i32 10, float %arg2)
|
||||
; CHECK-NEXT: call void (i32, i8**, i32, ...) @vararg.3.bb1(i32 %stat1.i, i8** %vargs.i, i32 %arg, i32 10, float %arg2)
|
||||
|
||||
; Test case to check that we do not extract a vararg function, if va_end is in
|
||||
; a block that is not outlined.
|
||||
|
@ -104,4 +104,4 @@ entry:
|
|||
|
||||
; CHECK-LABEL: @caller_with_signext
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK-NEXT: call void (i32*, ...) @vararg2.1_cond.end(i32* %foo, i32 signext 8)
|
||||
; CHECK-NEXT: call void (i32*, ...) @vararg2.1.cond.end(i32* %foo, i32 signext 8)
|
||||
|
|
|
@ -19,14 +19,14 @@ if.end: ; preds = %if.then, %entry
|
|||
|
||||
; CHECK-LABEL: @caller
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK-NEXT: call void (i32, i32*, ...) @callee.1_if.then(i32 %v, i32* %mul.loc.i, i32 99), !dbg ![[DBG2:[0-9]+]]
|
||||
; CHECK-NEXT: call void (i32, i32*, ...) @callee.1.if.then(i32 %v, i32* %mul.loc.i, i32 99), !dbg ![[DBG2:[0-9]+]]
|
||||
define i32 @caller(i32 %v) !dbg !8 {
|
||||
entry:
|
||||
%call = call i32 (i32, ...) @callee(i32 %v, i32 99), !dbg !14
|
||||
ret i32 %call, !dbg !15
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @callee.1_if.then
|
||||
; CHECK-LABEL: define internal void @callee.1.if.then
|
||||
; CHECK: br label %if.then, !dbg ![[DBG3:[0-9]+]]
|
||||
|
||||
; CHECK: ![[DBG1]] = !DILocation(line: 10, column: 7,
|
||||
|
|
|
@ -16,7 +16,7 @@ define internal i32 @dummyCaller(i1 %cond, i32* align 2 %align.val) {
|
|||
entry:
|
||||
; CHECK-LABEL: @dummyCaller
|
||||
; CHECK: br
|
||||
; CHECK: call void @inlinedFunc.1_
|
||||
; CHECK: call void @inlinedFunc.1.
|
||||
%val = call i32 @inlinedFunc(i1 %cond, i32* %align.val)
|
||||
ret i32 %val
|
||||
}
|
||||
|
|
|
@ -36,5 +36,5 @@ entry:
|
|||
attributes #0 = { nounwind readnone }
|
||||
attributes #1 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+sse4.1" }
|
||||
|
||||
; CHECK: define {{.*}} @inlinedFunc.1_if.then{{.*}} [[COUNT1:#[0-9]+]]
|
||||
; CHECK: define {{.*}} @inlinedFunc.1.if.then{{.*}} [[COUNT1:#[0-9]+]]
|
||||
; CHECK: [[COUNT1]] = { {{.*}} "target-cpu"="x86-64" "target-features"="+sse4.1" }
|
||||
|
|
|
@ -47,14 +47,14 @@ declare i32 @foo(i32* %arg)
|
|||
define i32 @dummy_caller(i32* %arg) local_unnamed_addr {
|
||||
; CHECK-LABEL: @dummy_caller
|
||||
%tmp = call i32 @outline_region_notlikely(i32* %arg)
|
||||
; CHECK: call void @outline_region_notlikely.2_bb1
|
||||
; CHECK: call void @outline_region_notlikely.2.bb1
|
||||
%tmp2 = tail call i32 @outline_region_likely(i32* %arg)
|
||||
; CHECK: %tmp2 = tail call i32 @outline_region_likely(i32* %arg)
|
||||
ret i32 %tmp
|
||||
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @outline_region_notlikely.2_bb1(i32* %arg) {
|
||||
; CHECK-LABEL: define internal void @outline_region_notlikely.2.bb1(i32* %arg) {
|
||||
; CHECK-NEXT: newFuncRoot:
|
||||
|
||||
!llvm.module.flags = !{!0}
|
||||
|
|
|
@ -28,7 +28,7 @@ define i32 @dummy_caller(i32* %arg) local_unnamed_addr {
|
|||
}
|
||||
|
||||
|
||||
; CHECK-LABEL: define internal void @outline_region_notlikely.1_bb1(i32* %arg) {
|
||||
; CHECK-LABEL: define internal void @outline_region_notlikely.1.bb1(i32* %arg) {
|
||||
; CHECK-NEXT: newFuncRoot:
|
||||
|
||||
declare i32 @foo(i32 * %arg)
|
||||
|
|
|
@ -42,11 +42,11 @@ entry:
|
|||
; CHECK: entry:
|
||||
; CHECK-NEXT: br i1
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK-NEXT: call void @callee.1_{{.*}}()
|
||||
; CHECK-NEXT: call void @callee.1.{{.*}}()
|
||||
call void @callee(i1 %cond)
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define {{.*}} @callee.1_{{.*}}() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
|
||||
; CHECK-LABEL: define {{.*}} @callee.1.{{.*}}() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
|
||||
; CHECK: invoke void @bar()
|
||||
; CHECK: landingpad
|
||||
|
|
|
@ -42,12 +42,12 @@ entry:
|
|||
; CHECK: entry:
|
||||
; CHECK-NEXT: br i1
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK-NEXT: call void @callee.1_{{.*}}()
|
||||
; CHECK-NEXT: call void @callee.1.{{.*}}()
|
||||
call void @callee(i1 %cond)
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define {{.*}} @callee.1_{{.*}}() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
|
||||
; CHECK-LABEL: define {{.*}} @callee.1.{{.*}}() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*)
|
||||
; CHECK: invoke void @bar()
|
||||
; CHECK: cleanuppad
|
||||
; CHECK-NEXT: cleanupret
|
||||
|
|
|
@ -41,13 +41,13 @@ bb:
|
|||
; CHECK-NOT: llvm.lifetime
|
||||
; CHECK: br i1
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK: call void @_Z3foov.1_
|
||||
; CHECK: call void @_Z3foov.1.
|
||||
|
||||
tail call void @_Z3foov()
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @_Z3foov.1_
|
||||
; CHECK-LABEL: define internal void @_Z3foov.1.
|
||||
; CHECK: newFuncRoot:
|
||||
; CHECK-NEXT: %tmp = alloca %class.A
|
||||
; CHECK-NEXT: %tmp1 = bitcast %class.A* %tmp to i8*
|
||||
|
|
|
@ -42,12 +42,12 @@ bb:
|
|||
; CHECK-NOT: llvm.lifetime
|
||||
; CHECK: br i1
|
||||
; CHECK: codeRepl.i:
|
||||
; CHECK: call void @_Z3foov.1_
|
||||
; CHECK: call void @_Z3foov.1.
|
||||
tail call void @_Z3foov()
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @_Z3foov.1_
|
||||
; CHECK-LABEL: define internal void @_Z3foov.1.
|
||||
; CHECK: newFuncRoot:
|
||||
; CHECK-NEXT: %tmp = alloca %class.A
|
||||
; CHECK-NEXT: %tmp1 = getelementptr
|
||||
|
|
|
@ -50,7 +50,7 @@ bb:
|
|||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @_Z3foov.1_
|
||||
; CHECK-LABEL: define internal void @_Z3foov.1.
|
||||
; CHECK: bb9:
|
||||
; CHECK: call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %tmp1)
|
||||
; CHECK: br label %.exitStub
|
||||
|
|
|
@ -42,7 +42,7 @@ bb:
|
|||
ret void
|
||||
}
|
||||
|
||||
; CHECK-LABEL: define internal void @_Z3foov.1_
|
||||
; CHECK-LABEL: define internal void @_Z3foov.1.
|
||||
; CHECK: newFuncRoot:
|
||||
; CHECK-NEXT: alloca
|
||||
; CHECK-NEXT: bitcast
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
; RUN: opt -S -partial-inliner %s | FileCheck %s
|
||||
|
||||
; CHECK-LABEL: define void @dipsy(
|
||||
; CHECK-NEXT: call void @tinkywinky.1_ontrue()
|
||||
; CHECK-NEXT: call void @tinkywinky.1.ontrue()
|
||||
; CHECK-NEXT: call void @patatuccio()
|
||||
; CHECK-NEXT: ret void
|
||||
; CHECK-NEXT: }
|
||||
|
||||
; CHECK-LABEL: define internal void @tinkywinky.1_ontrue() {
|
||||
; CHECK-LABEL: define internal void @tinkywinky.1.ontrue() {
|
||||
; CHECK-NEXT: newFuncRoot:
|
||||
; CHECK-NEXT: br label %ontrue
|
||||
; CHECK: onfalse{{.*}}:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
; CHECK-LABEL: @fun
|
||||
; CHECK: codeRepl:
|
||||
; CHECK-NEXT: call void @fun_if.else
|
||||
; CHECK-NEXT: call void @fun.cold.1
|
||||
|
||||
define void @fun() {
|
||||
entry:
|
||||
|
@ -28,5 +28,5 @@ cleanup:
|
|||
unreachable
|
||||
}
|
||||
|
||||
; CHECK: define {{.*}} @fun_if.else{{.*}}#[[outlined_func_attr:[0-9]+]]
|
||||
; CHECK: define {{.*}} @fun.cold.1{{.*}}#[[outlined_func_attr:[0-9]+]]
|
||||
; CHECK: attributes #[[outlined_func_attr]] = { {{.*}}minsize
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
; Make sure this compiles. This test used to fail with an invalid phi node: the
|
||||
; two predecessors were outlined and the SSA representation was invalid.
|
||||
|
||||
; CHECK: remark: <unknown>:0:0: fun split cold code into fun_if.else
|
||||
; CHECK: remark: <unknown>:0:0: fun split cold code into fun.cold.1
|
||||
; CHECK-LABEL: @fun
|
||||
; CHECK: codeRepl:
|
||||
; CHECK-NEXT: call void @fun_if.else
|
||||
; CHECK-NEXT: call void @fun.cold.1
|
||||
|
||||
define void @fun() {
|
||||
entry:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
; RUN: opt -hotcoldsplit -S < %s | FileCheck %s
|
||||
|
||||
; CHECK-LABEL: define {{.*}}@foo_if.end
|
||||
; CHECK-LABEL: define {{.*}}@foo.cold
|
||||
; CHECK-NOT: llvm.dbg.value
|
||||
|
||||
define void @foo(i32 %arg1) !dbg !6 {
|
||||
|
|
|
@ -12,7 +12,7 @@ bb:
|
|||
ret void
|
||||
}
|
||||
|
||||
; CHECK: @foo_bb4
|
||||
; CHECK: @foo.bb4
|
||||
; CHECK: call void @bar()
|
||||
; CHECK: %tmp5
|
||||
define i32 @foo(i32 %arg) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
; RUN: llvm-extract -S -bb foo:bb4 -bb foo:bb7 %s | FileCheck %s
|
||||
|
||||
; CHECK: @foo_bb4
|
||||
; CHECK: @foo_bb7
|
||||
; CHECK: @foo.bb4
|
||||
; CHECK: @foo.bb7
|
||||
define i32 @foo(i32 %arg) {
|
||||
bb:
|
||||
%tmp = alloca i32, align 4
|
||||
|
|
Loading…
Reference in New Issue