Lines Matching +full:non +full:- +full:updatable

1 //===- Inliner.cpp - Code common to all inliners --------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
13 //===----------------------------------------------------------------------===//
74 "intra-scc-cost-multiplier", cl::init(2), cl::Hidden,
77 "new call was previously an intra-SCC call (not relevant when the "
78 "original call was already intra-SCC). This can accumulate over "
82 "multiplied by intra-scc-cost-multiplier). This is to prevent tons of "
86 /// as part of the default (e.g. -O3) pipeline.
87 static cl::opt<bool> KeepAdvisorForPrinting("keep-inline-advisor-for-printing",
92 EnablePostSCCAdvisorPrinting("enable-scc-inline-advisor-printing",
97 "cgscc-inline-replay", cl::init(""), cl::value_desc("filename"),
104 "cgscc-inline-replay-scope",
117 "cgscc-inline-replay-fallback",
134 "cgscc-inline-replay-format",
152 while (InlineHistoryID != -1) {
170 // It should still be possible to run the inliner as a stand-alone SCC pass,
194 assert(IAA->getAdvisor() &&
197 return *IAA->getAdvisor();
216 Module &M = *InitialC.begin()->getFunction().getParent();
227 // process these in-order and append new calls introduced during inlining to
234 // other functions. Because the LLVM inliner is fundamentally a bottom-up
240 // bottom-up behavior. As a consequence, with heavily connected *SCCs* of
257 // We want to generally process call sites top-down in order for
264 if (Function *Callee = CB->getCalledFunction()) {
265 if (!Callee->isDeclaration())
266 Calls.push_back({CB, -1});
273 << NV("Caller", CB->getCaller())
281 // Capture updatable variable for the current SCC.
304 // Track potentially dead non-local functions with comdats to see if they can
315 Function &F = *Calls[I].first->getCaller();
324 auto GetAssumptionCache = [&](Function &F) -> AssumptionCache & {
332 for (; I < (int)Calls.size() && Calls[I].first->getCaller() == &F; ++I) {
336 Function &Callee = *CB->getCalledFunction();
338 if (InlineHistoryID != -1 &&
341 << " -> " << Callee.getName() << "\n");
345 CB->setIsNoInline();
358 << F.getName() << " -> " << Callee.getName() << "\n");
370 if (!Advice->isInliningRecommended()) {
371 Advice->recordUnattemptedInlining();
384 &FAM.getResult<BlockFrequencyAnalysis>(*(CB->getCaller())),
389 &FAM.getResult<AAManager>(*CB->getCaller()));
391 Advice->recordUnsuccessfulInlining(IR);
408 Function *NewCallee = ICB->getCalledFunction();
409 assert(!(NewCallee && NewCallee->isIntrinsic()) &&
413 // the post-inline cleanup and the next DevirtSCCRepeatedPass
417 NewCallee = ICB->getCalledFunction();
420 if (!NewCallee->isDeclaration()) {
429 // self-recursive which the inliner bails out on, and inlining
437 ICB->addFnAttr(NewCBCostMult);
447 // of other functions to one, changing inline cost thresholds. Non-local
456 return Call.first->getCaller() == &Callee;
472 Advice->recordInliningWithCalleeDeleted();
474 Advice->recordInlining();
479 --I;
489 // re-use the exact same logic for updating the call graph to reflect the
503 // mutation, we will revisit this function and potentially re-inline. If we
504 // do, and that re-inlining also has the potentially to mutate the SCC
548 // Note that this walks a pointer set which has non-deterministic order but
556 FAM.clear(*DeadF, DeadF->getName());
587 // Run the inliner first. The theory is that we are walking bottom-up and so
590 // For PreLinkThinLTO pass, we disable hot-caller heuristic for sample PGO
619 // in that case to try and catch knock-on inlining or function attrs
621 // in postorder (or bottom-up).
643 static_cast<PassInfoMixin<InlinerPass> *>(this)->printPipeline(
646 OS << "<only-mandatory>";