LLVM: lib/Analysis/InlineAdvisor.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

32

33using namespace llvm;

34#define DEBUG_TYPE "inline"

35#ifdef LLVM_HAVE_TF_AOT_INLINERSIZEMODEL

36#define LLVM_HAVE_TF_AOT

37#endif

38

39

40

41

42STATISTIC(NumCallerCallersAnalyzed, "Number of caller-callers analyzed");

43

44

48 cl::desc("Enable adding inline-remark attribute to"

49 " callsites processed by inliner but decided"

50 " to be not inlined"));

51

54 cl::desc("Enable deferred inlining"));

55

56

57

60 cl::desc("Scale to limit the cost of inline deferral"),

62

65 cl::desc("If true, annotate inline advisor remarks "

66 "with LTO and pass information."));

67

68

69

71 "ml-inliner-ir2vec-vocab-file", cl::Hidden,

72 cl::desc("Vocab file for IR2Vec; Setting this enables "

73 "configuring the model to use IR2Vec embeddings."));

74

75namespace llvm {

77}

78

79namespace {

81class MandatoryInlineAdvice : public InlineAdvice {

82public:

85 bool IsInliningMandatory)

86 : InlineAdvice(Advisor, CB, ORE, IsInliningMandatory) {}

87

88private:

89 void recordInliningWithCalleeDeletedImpl() override { recordInliningImpl(); }

90

91 void recordInliningImpl() override {

92 if (IsInliningRecommended)

95 Remark << ": always inline attribute";

96 });

97 }

98

99 void recordUnsuccessfulInliningImpl(const InlineResult &Result) override {

100 if (IsInliningRecommended)

101 ORE.emit([&]() {

103 "NotInlined", DLoc, Block)

104 << "'" << NV("Callee", Callee) << "' is not AlwaysInline into '"

105 << NV("Caller", Caller)

106 << "': " << NV("Reason", Result.getFailureReason());

107 });

108 }

109

110 void recordUnattemptedInliningImpl() override {

111 assert(!IsInliningRecommended && "Expected to attempt inlining");

112 }

113};

114}

115

116void DefaultInlineAdvice::recordUnsuccessfulInliningImpl(

118 using namespace ore;

121 ORE.emit([&]() {

122 return OptimizationRemarkMissed(Advisor->getAnnotatedInlinePassName(),

124 << "'" << NV("Callee", Callee) << "' is not inlined into '"

126 << "': " << NV("Reason", Result.getFailureReason());

127 });

128}

129

131 if (EmitRemarks)

133 false,

134 Advisor->getAnnotatedInlinePassName());

135}

136

138 if (EmitRemarks)

140 false,

141 Advisor->getAnnotatedInlinePassName());

142}

143

149 .getCachedResult(

150 *CB.getParent()->getParent()->getParent());

151

155 };

158 };

161 };

162 auto GetEphValuesCache =

165 };

166

169 auto GetInlineCost = [&](CallBase &CB) {

170 bool RemarksEnabled =

171 Callee.getContext().getDiagHandlerPtr()->isMissedOptRemarkEnabled(

173 return getInlineCost(CB, Params, CalleeTTI, GetAssumptionCache, GetTLI,

174 GetBFI, PSI, RemarksEnabled ? &ORE : nullptr,

175 GetEphValuesCache);

176 };

178 CB, CalleeTTI, GetInlineCost, ORE,

180}

181

182std::unique_ptr

183DefaultInlineAdvisor::getAdviceImpl(CallBase &CB) {

185 return std::make_unique(

186 this, CB, OIC,

187 FAM.getResult(*CB.getCaller()));

188}

189

196

197void InlineAdvice::recordInlineStatsIfNeeded() {

200}

201

203 markRecorded();

204 recordInlineStatsIfNeeded();

206}

207

209 markRecorded();

210 recordInlineStatsIfNeeded();

212}

213

216

217bool InlineAdvisorAnalysis::initializeIR2VecVocabIfRequested(

221 if (!IR2VecVocabResult.isValid()) {

222 M.getContext().emitError("Failed to load IR2Vec vocabulary");

223 return false;

224 }

225 }

226

227

228 return true;

229}

230

237 Advisor.reset(DA.Factory(M, FAM, Params, IC));

238 return !!Advisor;

239 }

240 auto GetDefaultAdvice = [&FAM, Params](CallBase &CB) {

242 return OIC.has_value();

243 };

244 switch (Mode) {

246 LLVM_DEBUG(dbgs() << "Using default inliner heuristic.\n");

248

249

252 std::move(Advisor), ReplaySettings,

253 true, IC);

254 }

255 break;

256

257

258

260#ifdef LLVM_HAVE_TFLITE

261 LLVM_DEBUG(dbgs() << "Using development-mode inliner policy.\n");

262 if (!InlineAdvisorAnalysis::initializeIR2VecVocabIfRequested(M, MAM))

263 return false;

265#endif

266 break;

268 LLVM_DEBUG(dbgs() << "Using release-mode inliner policy.\n");

269 if (!InlineAdvisorAnalysis::initializeIR2VecVocabIfRequested(M, MAM))

270 return false;

272 break;

273 }

274

275 return !!Advisor;

276}

277

278

279

280

281

282

283static bool

285 InlineCost IC, int &TotalSecondaryCost,

287

288 if (!Caller->hasLocalLinkage() && !Caller->hasLinkOnceODRLinkage())

289 return false;

290

291

292

294 return false;

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311 TotalSecondaryCost = 0;

312

313 int CandidateCost = IC.getCost() - 1;

314

315

316 bool ApplyLastCallBonus = Caller->hasLocalLinkage() && !Caller->hasOneUse();

317

318 bool InliningPreventsSomeOuterInline = false;

319 unsigned NumCallerUsers = 0;

320 for (User *U : Caller->users()) {

322

323

324

325

327 ApplyLastCallBonus = false;

328 continue;

329 }

330

331 InlineCost IC2 = GetInlineCost(*CS2);

332 ++NumCallerCallersAnalyzed;

333 if (!IC2) {

334 ApplyLastCallBonus = false;

335 continue;

336 }

338 continue;

339

340

341

342

344 InliningPreventsSomeOuterInline = true;

345 TotalSecondaryCost += IC2.getCost();

346 NumCallerUsers++;

347 }

348 }

349

350 if (!InliningPreventsSomeOuterInline)

351 return false;

352

353

354

355

356

357 if (ApplyLastCallBonus)

359

360

361

363 return TotalSecondaryCost < IC.getCost();

364

365 int TotalCost = TotalSecondaryCost + IC.getCost() * NumCallerUsers;

367 return TotalCost < Allowance;

368}

369

370namespace llvm {

372 return R << Arg.Val;

373}

374

375template

376decltype(auto) operator<<(RemarkT &&R, const InlineCost &IC) {

377 using namespace ore;

379 R << "(cost=always)";

380 } else if (IC.isNever()) {

381 R << "(cost=never)";

382 } else {

385 }

386 if (const char *Reason = IC.getReason())

387 R << ": " << ore::NV("Reason", Reason);

388 return std::forward(R);

389}

390}

391

393 std::string Buffer;

397}

398

406

407

408

409

410

411std::optional

415 using namespace ore;

416

421

424 << ", Call: " << CB << "\n");

425 return IC;

426 }

427

428 if (!IC) {

430 << ", Call: " << CB << "\n");

432 ORE.emit([&]() {

434 << "'" << NV("Callee", Callee) << "' not inlined into '"

435 << NV("Caller", Caller)

436 << "' because it should never be inlined " << IC;

437 });

438 } else {

439 ORE.emit([&]() {

441 << "'" << NV("Callee", Callee) << "' not inlined into '"

442 << NV("Caller", Caller) << "' because too costly to inline "

443 << IC;

444 });

445 }

447 return std::nullopt;

448 }

449

450 int TotalSecondaryCost = 0;

451 if (EnableDeferral && shouldBeDeferred(Caller, CalleeTTI, IC,

452 TotalSecondaryCost, GetInlineCost)) {

454 << " Cost = " << IC.getCost()

455 << ", outer Cost = " << TotalSecondaryCost << '\n');

456 ORE.emit([&]() {

459 << "Not inlining. Cost of inlining '" << NV("Callee", Callee)

460 << "' increases the cost of inlining '" << NV("Caller", Caller)

461 << "' in other contexts";

462 });

464 return std::nullopt;

465 }

466

468 << '\n');

469 return IC;

470}

471

474 std::string Buffer;

476 bool First = true;

477 for (DILocation *DIL = DLoc.get(); DIL; DIL = DIL->getInlinedAt()) {

479 CallSiteLoc << " @ ";

480

481

482

484 DIL->getLine() - DIL->getScope()->getSubprogram()->getLine();

485 uint32_t Discriminator = DIL->getBaseDiscriminator();

486 StringRef Name = DIL->getScope()->getSubprogram()->getLinkageName();

487 if (Name.empty())

488 Name = DIL->getScope()->getSubprogram()->getName();

490 if (Format.outputColumn())

491 CallSiteLoc << ":" << llvm::utostr(DIL->getColumn());

492 if (Format.outputDiscriminator() && Discriminator)

493 CallSiteLoc << "." << llvm::utostr(Discriminator);

495 }

496

497 return CallSiteLoc.str();

498}

499

501 if (!DLoc) {

502 return;

503 }

504

505 bool First = true;

506 Remark << " at callsite ";

507 for (DILocation *DIL = DLoc.get(); DIL; DIL = DIL->getInlinedAt()) {

510 unsigned int Offset = DIL->getLine();

511 Offset -= DIL->getScope()->getSubprogram()->getLine();

512 unsigned int Discriminator = DIL->getBaseDiscriminator();

513 StringRef Name = DIL->getScope()->getSubprogram()->getLinkageName();

514 if (Name.empty())

515 Name = DIL->getScope()->getSubprogram()->getName();

517 << ore::NV("Column", DIL->getColumn());

518 if (Discriminator)

521 }

522

524}

525

528 const Function &Callee, const Function &Caller, bool AlwaysInline,

531 ORE.emit([&]() {

532 StringRef RemarkName = AlwaysInline ? "AlwaysInline" : "Inlined";

535 Remark << "'" << ore::NV("Callee", &Callee) << "' inlined into '"

536 << ore::NV("Caller", &Caller) << "'";

537 if (ExtraContext)

538 ExtraContext(Remark);

541 });

542}

543

547 bool ForProfileContext, const char *PassName) {

551 if (ForProfileContext)

552 Remark << " to match profiling context";

553 Remark << " with " << IC;

554 },

556}

557

559 std::optional IC)

566 std::make_unique();

568 }

569}

570

578

580 bool Advice) {

581 return std::make_unique(this, CB, getCallerORE(CB),

582 Advice);

583}

584

586 switch (LTOPhase) {

588 return "main";

591 return "prelink";

594 return "postlink";

595 }

597}

598

600 switch (IP) {

602 return "always-inline";

604 return "cgscc-inline";

606 return "early-inline";

608 return "ml-inline";

610 return "module-inline";

612 return "replay-cgscc-inline";

614 return "replay-sample-profile-inline";

616 return "sample-profile-inline";

617 }

618

620}

621

626

631

634 };

635

637

638 auto TrivialDecision =

640

641 if (TrivialDecision) {

642 if (TrivialDecision->isSuccess())

644 else

646 }

648}

649

651 bool MandatoryOnly) {

652 if (!MandatoryOnly)

658}

659

663

667 if (!IA)

668 OS << "No Inline Advisor\n";

669 else

670 IA->getAdvisor()->print(OS);

672}

673

677 const auto &MAMProxy =

679

680 if (InitialC.size() == 0) {

681 OS << "SCC is empty!\n";

683 }

684 Module &M = *InitialC.begin()->getFunction().getParent();

686 if (!IA)

687 OS << "No Inline Advisor\n";

688 else

689 IA->getAdvisor()->print(OS);

691}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

static const Function * getParent(const Value *V)

This file defines the IR2Vec vocabulary analysis(IR2VecVocabAnalysis), the core ir2vec::Embedder inte...

Module.h This file contains the declarations for the Module class.

This header defines various interfaces for pass management in LLVM.

static bool shouldBeDeferred(Function *Caller, TargetTransformInfo &CalleeTTI, InlineCost IC, int &TotalSecondaryCost, function_ref< InlineCost(CallBase &CB)> GetInlineCost)

Return true if inlining of CB can block the caller from being inlined which is proved to be more bene...

Definition InlineAdvisor.cpp:284

static cl::opt< int > InlineDeferralScale("inline-deferral-scale", cl::desc("Scale to limit the cost of inline deferral"), cl::init(2), cl::Hidden)

static cl::opt< bool > InlineRemarkAttribute("inline-remark-attribute", cl::init(false), cl::Hidden, cl::desc("Enable adding inline-remark attribute to" " callsites processed by inliner but decided" " to be not inlined"))

Flag to add inline messages as callsite attributes 'inline-remark'.

static cl::opt< bool > EnableInlineDeferral("inline-deferral", cl::init(false), cl::Hidden, cl::desc("Enable deferred inlining"))

static cl::opt< bool > AnnotateInlinePhase("annotate-inline-phase", cl::Hidden, cl::init(false), cl::desc("If true, annotate inline advisor remarks " "with LTO and pass information."))

static const char * getLTOPhase(ThinOrFullLTOPhase LTOPhase)

Definition InlineAdvisor.cpp:585

static std::optional< llvm::InlineCost > getDefaultInlineAdvice(CallBase &CB, FunctionAnalysisManager &FAM, const InlineParams &Params)

Definition InlineAdvisor.cpp:144

static const char * getInlineAdvisorContext(InlinePass IP)

Definition InlineAdvisor.cpp:599

static cl::opt< std::string > IR2VecVocabFile("ml-inliner-ir2vec-vocab-file", cl::Hidden, cl::desc("Vocab file for IR2Vec; Setting this enables " "configuring the model to use IR2Vec embeddings."))

static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)

Return the first DebugLoc that has line number information, given a range of instructions.

static const Function * getCalledFunction(const Value *V)

FunctionAnalysisManager FAM

ModuleAnalysisManager MAM

This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...

#define STATISTIC(VARNAME, DESC)

This pass exposes codegen information to IR-level passes.

static const char PassName[]

PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)

Get the result of an analysis pass for a given IR unit.

A function analysis which provides an AssumptionCache.

A cache of @llvm.assume calls within a function.

Functions, function parameters, and return types can have attributes to indicate how they should be t...

static LLVM_ABI Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val=0)

Return a uniquified Attribute object.

LLVM Basic Block Representation.

Analysis pass which computes BlockFrequencyInfo.

BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...

Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...

void addFnAttr(Attribute::AttrKind Kind)

Adds the attribute to the function.

Function * getCalledFunction() const

Returns the function called, or null if this is an indirect function invocation or the function signa...

LLVM_ABI Function * getCaller()

Helper to get the caller (the parent function).

LLVM_ABI DILocation * get() const

Get the underlying DILocation.

The default (manual heuristics) implementation of the InlineAdvisor.

EphemeralValuesCache Result

This analysis provides the vocabulary for IR2Vec.

Capture state between an inlining decision having had been made, and its impact being observable.

Function *const Caller

Caller and Callee are pre-inlining.

virtual void recordInliningWithCalleeDeletedImpl()

virtual void recordInliningImpl()

const BasicBlock *const Block

LLVM_ABI void recordInlining()

Exactly one of the record* APIs must be called.

Definition InlineAdvisor.cpp:202

OptimizationRemarkEmitter & ORE

InlineAdvisor *const Advisor

LLVM_ABI InlineAdvice(InlineAdvisor *Advisor, CallBase &CB, OptimizationRemarkEmitter &ORE, bool IsInliningRecommended)

Definition InlineAdvisor.cpp:190

LLVM_ABI void recordInliningWithCalleeDeleted()

Call after inlining succeeded, and results in the callee being delete-able, meaning,...

Definition InlineAdvisor.cpp:208

const bool IsInliningRecommended

LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM)

Definition InlineAdvisor.cpp:665

The InlineAdvisorAnalysis is a module pass because the InlineAdvisor needs to capture state right bef...

static LLVM_ABI AnalysisKey Key

Interface for deciding whether to inline a call site or not.

const std::optional< InlineContext > IC

OptimizationRemarkEmitter & getCallerORE(CallBase &CB)

Definition InlineAdvisor.cpp:660

FunctionAnalysisManager & FAM

static MandatoryInliningKind getMandatoryKind(CallBase &CB, FunctionAnalysisManager &FAM, OptimizationRemarkEmitter &ORE)

Definition InlineAdvisor.cpp:628

virtual ~InlineAdvisor()

Definition InlineAdvisor.cpp:571

const std::string AnnotatedInlinePassName

virtual std::unique_ptr< InlineAdvice > getMandatoryAdvice(CallBase &CB, bool Advice)

Definition InlineAdvisor.cpp:579

std::unique_ptr< ImportedFunctionsInliningStatistics > ImportedFunctionsStats

const char * getAnnotatedInlinePassName() const

NOTE pass name is annotated only when inline advisor constructor provides InlineContext.

InlineAdvisor(InlineAdvisor &&)=delete

virtual std::unique_ptr< InlineAdvice > getAdviceImpl(CallBase &CB)=0

std::unique_ptr< InlineAdvice > getAdvice(CallBase &CB, bool MandatoryOnly=false)

Get an InlineAdvice containing a recommendation on whether to inline or not.

Definition InlineAdvisor.cpp:650

Represents the cost of inlining a function.

int getThreshold() const

Get the threshold against which the cost was computed.

const char * getReason() const

Get the reason of Always or Never.

int getCost() const

Get the inline cost estimate.

int getCostDelta() const

Get the cost delta from the threshold for inlining.

InlineResult is basically true or false.

An SCC of the call graph.

A lazily constructed view of the call graph of a module.

A Module instance is used to store all the information related to an LLVM module.

Used for dynamically registering InlineAdvisors as plugins.

static LLVM_ABI AnalysisKey Key

A set of analyses that are preserved following a run of a transformation pass.

static PreservedAnalyses all()

Construct a special preserved set that preserves all passes.

Analysis providing profile information.

StringRef - Represent a constant reference to a string, i.e.

constexpr bool empty() const

empty - Check if the string is empty.

Analysis pass providing the TargetTransformInfo.

Analysis pass providing the TargetLibraryInfo.

Provides information about what library functions are available for the current target.

This pass provides access to the codegen interfaces that are needed for IR-level transformations.

LLVM_ABI int getInliningLastCallToStaticBonus() const

LLVM_ABI LLVMContext & getContext() const

All values hold a context through their type.

An efficient, type-erasing, non-owning reference to a callable.

const ParentTy * getParent() const

This class implements an extremely fast bulk output stream that can only output to a stream.

A raw_ostream that writes to an std::string.

std::string & str()

Returns the string's reference.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

initializer< Ty > init(const Ty &Val)

Add a small namespace to avoid name clashes with the classes used in the streaming interface.

DiagnosticInfoOptimizationBase::Argument NV

This is an optimization pass for GlobalISel generic memory operations.

@ ReplaySampleProfileInliner

LLVM_ABI void emitInlinedInto(OptimizationRemarkEmitter &ORE, DebugLoc DLoc, const BasicBlock *Block, const Function &Callee, const Function &Caller, bool IsMandatory, function_ref< void(OptimizationRemark &)> ExtraContext={}, const char *PassName=nullptr)

Emit ORE message.

Definition InlineAdvisor.cpp:526

LLVM_ABI std::string inlineCostStr(const InlineCost &IC)

Utility for extracting the inline cost message to a string.

Definition InlineAdvisor.cpp:392

decltype(auto) dyn_cast(const From &Val)

dyn_cast - Return the argument parameter cast to the specified type.

InliningAdvisorMode

There are 4 scenarios we can use the InlineAdvisor:

LLVM_ABI std::optional< InlineCost > shouldInline(CallBase &CB, TargetTransformInfo &CalleeTTI, function_ref< InlineCost(CallBase &CB)> GetInlineCost, OptimizationRemarkEmitter &ORE, bool EnableDeferral=true)

Return the cost only if the inliner should attempt to inline at the given CallSite.

Definition InlineAdvisor.cpp:412

OuterAnalysisManagerProxy< ModuleAnalysisManager, Function > ModuleAnalysisManagerFunctionProxy

Provide the ModuleAnalysisManager to Function proxy.

LLVM_ABI std::unique_ptr< InlineAdvisor > getDevelopmentModeAdvisor(Module &M, ModuleAnalysisManager &MAM, std::function< bool(CallBase &)> GetDefaultAdvice)

LLVM_ABI std::unique_ptr< InlineAdvisor > getReleaseModeAdvisor(Module &M, ModuleAnalysisManager &MAM, std::function< bool(CallBase &)> GetDefaultAdvice)

InnerAnalysisManagerProxy< FunctionAnalysisManager, Module > FunctionAnalysisManagerModuleProxy

Provide the FunctionAnalysisManager to Module proxy.

std::string utostr(uint64_t X, bool isNeg=false)

LLVM_ABI void setInlineRemark(CallBase &CB, StringRef Message)

Set the inline-remark attribute.

Definition InlineAdvisor.cpp:399

AnalysisManager< LazyCallGraph::SCC, LazyCallGraph & > CGSCCAnalysisManager

The CGSCC analysis manager.

LLVM_ABI std::string AnnotateInlinePassName(InlineContext IC)

Definition InlineAdvisor.cpp:622

ThinOrFullLTOPhase

This enumerates the LLVM full LTO or ThinLTO optimization phases.

@ FullLTOPreLink

Full LTO prelink phase.

@ ThinLTOPostLink

ThinLTO postlink (backend compile) phase.

@ None

No LTO/ThinLTO behavior needed.

@ FullLTOPostLink

Full LTO postlink (backend compile) phase.

@ ThinLTOPreLink

ThinLTO prelink (summary) phase.

LLVM_ABI raw_ostream & dbgs()

dbgs() - This returns a reference to a raw_ostream for debugging messages.

LLVM_ABI void emitInlinedIntoBasedOnCost(OptimizationRemarkEmitter &ORE, DebugLoc DLoc, const BasicBlock *Block, const Function &Callee, const Function &Caller, const InlineCost &IC, bool ForProfileContext=false, const char *PassName=nullptr)

Emit ORE message based in cost (default heuristic).

Definition InlineAdvisor.cpp:544

std::unique_ptr< InlineAdvisor > getReplayInlineAdvisor(Module &M, FunctionAnalysisManager &FAM, LLVMContext &Context, std::unique_ptr< InlineAdvisor > OriginalAdvisor, const ReplayInlinerSettings &ReplaySettings, bool EmitRemarks, InlineContext IC)

LLVM_ABI InlineCost getInlineCost(CallBase &Call, const InlineParams &Params, TargetTransformInfo &CalleeTTI, function_ref< AssumptionCache &(Function &)> GetAssumptionCache, function_ref< const TargetLibraryInfo &(Function &)> GetTLI, function_ref< BlockFrequencyInfo &(Function &)> GetBFI=nullptr, ProfileSummaryInfo *PSI=nullptr, OptimizationRemarkEmitter *ORE=nullptr, function_ref< EphemeralValuesCache &(Function &)> GetEphValuesCache=nullptr)

Get an InlineCost object representing the cost of inlining this callsite.

@ First

Helpers to iterate all locations in the MemoryEffectsBase class.

LLVM_ABI std::optional< InlineResult > getAttributeBasedInliningDecision(CallBase &Call, Function *Callee, TargetTransformInfo &CalleeTTI, function_ref< const TargetLibraryInfo &(Function &)> GetTLI)

Returns InlineResult::success() if the call site should be always inlined because of user directives,...

OuterAnalysisManagerProxy< ModuleAnalysisManager, LazyCallGraph::SCC, LazyCallGraph & > ModuleAnalysisManagerCGSCCProxy

A proxy from a ModuleAnalysisManager to an SCC.

cl::opt< InlinerFunctionImportStatsOpts > InlinerFunctionImportStats("inliner-function-import-stats", cl::init(InlinerFunctionImportStatsOpts::No), cl::values(clEnumValN(InlinerFunctionImportStatsOpts::Basic, "basic", "basic statistics"), clEnumValN(InlinerFunctionImportStatsOpts::Verbose, "verbose", "printing of statistics for each inlined function")), cl::Hidden, cl::desc("Enable inliner stats for imported functions"))

Definition InlineAdvisor.cpp:76

raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)

LLVM_ABI void addLocationToRemarks(OptimizationRemark &Remark, DebugLoc DLoc)

Add location info to ORE message.

Definition InlineAdvisor.cpp:500

AnalysisManager< Function > FunctionAnalysisManager

Convenience typedef for the Function analysis manager.

std::string formatCallSiteLocation(DebugLoc DLoc, const CallSiteFormat &Format)

Get call site location as a string with the given format.

Definition InlineAdvisor.cpp:472

AnalysisManager< Module > ModuleAnalysisManager

Convenience typedef for the Module analysis manager.

A special type used by analysis passes to provide an address that identifies that particular analysis...

Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...

LLVM_ABI bool tryCreate(InlineParams Params, InliningAdvisorMode Mode, const ReplayInlinerSettings &ReplaySettings, InlineContext IC)

Definition InlineAdvisor.cpp:231

Provides context on when an inline advisor is constructed in the pipeline (e.g., link phase,...

ThinOrFullLTOPhase LTOPhase

Thresholds to tune inline cost analysis.

std::optional< bool > EnableDeferral

Indicate whether we should allow inline deferral.