/// The callee's function attributes are merged into the callers' if
/// MergeAttributes is set to true.
InlineResult InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
+ bool MergeAttributes = false,
AAResults *CalleeAAR = nullptr,
bool InsertLifetime = true,
- Function *ForwardVarArgsTo = nullptr,
- bool MergeAttributes = false);
+ Function *ForwardVarArgsTo = nullptr);
/// Clones a loop \p OrigLoop. Returns the loop and the blocks in \p
/// Blocks.
&FAM.getResult<BlockFrequencyAnalysis>(*Caller),
&FAM.getResult<BlockFrequencyAnalysis>(F));
- InlineResult Res = InlineFunction(
- *CB, IFI, &FAM.getResult<AAManager>(F), InsertLifetime,
- /*ForwardVarArgsTo=*/nullptr,
- /*MergeAttributes=*/true);
+ InlineResult Res =
+ InlineFunction(*CB, IFI, /*MergeAttributes=*/true,
+ &FAM.getResult<AAManager>(F), InsertLifetime);
if (!Res.isSuccess()) {
ORE.emit([&]() {
return OptimizationRemarkMissed(DEBUG_TYPE, "NotInlined", DLoc,
// Try to inline the function. Get the list of static allocas that were
// inlined.
- InlineResult IR = InlineFunction(CB, IFI, &AAR, InsertLifetime,
- /*ForwardVarArgsTo=*/nullptr,
- /*MergeAttributes=*/true);
+ InlineResult IR =
+ InlineFunction(CB, IFI,
+ /*MergeAttributes=*/true, &AAR, InsertLifetime);
if (!IR.isSuccess())
return IR;
&FAM.getResult<BlockFrequencyAnalysis>(Callee));
InlineResult IR =
- InlineFunction(*CB, IFI, &FAM.getResult<AAManager>(*CB->getCaller()),
- /*InsertLifetime=*/true,
- /*ForwardVarArgsTo=*/nullptr,
- /*MergeAttributes=*/true);
+ InlineFunction(*CB, IFI, /*MergeAttributes=*/true,
+ &FAM.getResult<AAManager>(*CB->getCaller()));
if (!IR.isSuccess()) {
Advice->recordUnsuccessfulInlining(IR);
continue;
&FAM.getResult<BlockFrequencyAnalysis>(Callee));
InlineResult IR =
- InlineFunction(*CB, IFI, &FAM.getResult<AAManager>(*CB->getCaller()),
- /*InsertLifetime=*/true,
- /*ForwardVarArgsTo=*/nullptr,
- /*MergeAttributes=*/true);
+ InlineFunction(*CB, IFI, /*MergeAttributes=*/true,
+ &FAM.getResult<AAManager>(*CB->getCaller()));
if (!IR.isSuccess()) {
Advice->recordUnsuccessfulInlining(IR);
continue;
InlineFunctionInfo IFI(nullptr, GetAssumptionCache, &PSI);
// We can only forward varargs when we outlined a single region, else we
// bail on vararg functions.
- if (!InlineFunction(*CB, IFI, nullptr, true,
+ if (!InlineFunction(*CB, IFI, /*MergeAttributes=*/false, nullptr, true,
(Cloner.ClonedOI ? Cloner.OutlinedFunctions.back().first
: nullptr))
.isSuccess())
InlineFunctionInfo IFI(nullptr, GetAC);
IFI.UpdateProfile = false;
InlineResult IR = InlineFunction(CB, IFI,
- /*CalleeAAR=*/nullptr,
- /*InsertLifetime=*/true,
- /*ForwardVarArgsTo=*/nullptr,
/*MergeAttributes=*/true);
if (!IR.isSuccess())
return false;
/// exists in the instruction stream. Similarly this will inline a recursive
/// function by one level.
llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
+ bool MergeAttributes,
AAResults *CalleeAAR,
bool InsertLifetime,
- Function *ForwardVarArgsTo,
- bool MergeAttributes) {
+ Function *ForwardVarArgsTo) {
assert(CB.getParent() && CB.getFunction() && "Instruction not in function!");
// FIXME: we don't inline callbr yet.