Skip to content

Commit 90b2379

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.6 [skip ci]
1 parent a9235b5 commit 90b2379

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

llvm/lib/Transforms/IPO/AlwaysInliner.cpp

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,36 @@ bool canInlineCallBase(CallBase *CB) {
3535
!CB->getAttributes().hasFnAttr(Attribute::NoInline);
3636
}
3737

38-
bool attemptInlineFunction(
39-
Function &F, CallBase *CB, bool InsertLifetime,
40-
function_ref<AAResults &(Function &)> &GetAAR,
41-
function_ref<AssumptionCache &(Function &)> &GetAssumptionCache,
42-
ProfileSummaryInfo &PSI) {
43-
Function *Caller = CB->getCaller();
44-
OptimizationRemarkEmitter ORE(Caller);
45-
DebugLoc DLoc = CB->getDebugLoc();
46-
BasicBlock *Block = CB->getParent();
47-
48-
InlineFunctionInfo IFI(GetAssumptionCache, &PSI, nullptr, nullptr);
49-
InlineResult Res = InlineFunction(*CB, IFI, /*MergeAttributes=*/true,
50-
&GetAAR(F), InsertLifetime);
51-
if (!Res.isSuccess()) {
52-
ORE.emit([&]() {
53-
return OptimizationRemarkMissed(DEBUG_TYPE, "NotInlined", DLoc, Block)
54-
<< "'" << ore::NV("Callee", &F) << "' is not inlined into '"
55-
<< ore::NV("Caller", Caller)
56-
<< "': " << ore::NV("Reason", Res.getFailureReason());
57-
});
58-
return false;
59-
}
38+
bool attemptInlineFunction(
39+
Function &F, CallBase *CB, bool InsertLifetime,
40+
function_ref<AAResults &(Function &)> &GetAAR,
41+
function_ref<AssumptionCache &(Function &)> &GetAssumptionCache,
42+
ProfileSummaryInfo &PSI) {
43+
Function *Caller = CB->getCaller();
44+
OptimizationRemarkEmitter ORE(Caller);
45+
DebugLoc DLoc = CB->getDebugLoc();
46+
BasicBlock *Block = CB->getParent();
47+
48+
InlineFunctionInfo IFI(GetAssumptionCache, &PSI, nullptr, nullptr);
49+
InlineResult Res = InlineFunction(*CB, IFI, /*MergeAttributes=*/true,
50+
&GetAAR(F), InsertLifetime);
51+
if (!Res.isSuccess()) {
52+
ORE.emit([&]() {
53+
return OptimizationRemarkMissed(DEBUG_TYPE, "NotInlined", DLoc, Block)
54+
<< "'" << ore::NV("Callee", &F) << "' is not inlined into '"
55+
<< ore::NV("Caller", Caller)
56+
<< "': " << ore::NV("Reason", Res.getFailureReason());
57+
});
58+
return false;
59+
}
6060

61-
emitInlinedIntoBasedOnCost(ORE, DLoc, Block, F, *Caller,
62-
InlineCost::getAlways("always inline attribute"),
63-
/*ForProfileContext=*/false, DEBUG_TYPE);
61+
emitInlinedIntoBasedOnCost(ORE, DLoc, Block, F, *Caller,
62+
InlineCost::getAlways("always inline attribute"),
63+
/*ForProfileContext=*/false, DEBUG_TYPE);
64+
65+
return true;
66+
}
6467

65-
return true;
66-
}
6768
/// This function inlines all functions that are marked with the always_inline
6869
/// attribute. It also removes the inlined functions if they are dead after the
6970
/// inlining process.

0 commit comments

Comments
 (0)