LLVM  15.0.0git
InlineAdvisor.h
Go to the documentation of this file.
1 //===- InlineAdvisor.h - Inlining decision making abstraction -*- C++ ---*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 #ifndef LLVM_ANALYSIS_INLINEADVISOR_H
10 #define LLVM_ANALYSIS_INLINEADVISOR_H
11 
15 #include "llvm/Config/llvm-config.h"
16 #include "llvm/IR/PassManager.h"
17 #include <memory>
18 
19 namespace llvm {
20 class BasicBlock;
21 class CallBase;
22 class Function;
23 class Module;
24 class OptimizationRemark;
25 class ImportedFunctionsInliningStatistics;
26 class OptimizationRemarkEmitter;
27 struct ReplayInlinerSettings;
28 
29 /// There are 3 scenarios we can use the InlineAdvisor:
30 /// - Default - use manual heuristics.
31 ///
32 /// - Release mode, the expected mode for production, day to day deployments.
33 /// In this mode, when building the compiler, we also compile a pre-trained ML
34 /// model to native code, and link it as a static library. This mode has low
35 /// overhead and no additional dependencies for the compiler runtime.
36 ///
37 /// - Development mode, for training new models.
38 /// In this mode, we trade off runtime performance for flexibility. This mode
39 /// requires the full C Tensorflow API library, and evaluates models
40 /// dynamically. This mode also permits generating training logs, for offline
41 /// training.
43 
44 // Each entry represents an inline driver.
45 enum class InlinePass : int {
50  MLInliner,
54 };
55 
56 /// Provides context on when an inline advisor is constructed in the pipeline
57 /// (e.g., link phase, inline driver).
58 struct InlineContext {
60 
62 };
63 
65 
66 class InlineAdvisor;
67 /// Capture state between an inlining decision having had been made, and
68 /// its impact being observable. When collecting model training data, this
69 /// allows recording features/decisions/partial reward data sets.
70 ///
71 /// Derivations of this type are expected to be tightly coupled with their
72 /// InliningAdvisors. The base type implements the minimal contractual
73 /// obligations.
74 class InlineAdvice {
75 public:
78 
79  InlineAdvice(InlineAdvice &&) = delete;
80  InlineAdvice(const InlineAdvice &) = delete;
81  virtual ~InlineAdvice() {
82  assert(Recorded && "InlineAdvice should have been informed of the "
83  "inliner's decision in all cases");
84  }
85 
86  /// Exactly one of the record* APIs must be called. Implementers may extend
87  /// behavior by implementing the corresponding record*Impl.
88  ///
89  /// Call after inlining succeeded, and did not result in deleting the callee.
90  void recordInlining();
91 
92  /// Call after inlining succeeded, and results in the callee being
93  /// delete-able, meaning, it has no more users, and will be cleaned up
94  /// subsequently.
96 
97  /// Call after the decision for a call site was to not inline.
99  markRecorded();
101  }
102 
103  /// Call to indicate inlining was not attempted.
105  markRecorded();
107  }
108 
109  /// Get the inlining recommendation.
111  const DebugLoc &getOriginalCallSiteDebugLoc() const { return DLoc; }
112  const BasicBlock *getOriginalCallSiteBasicBlock() const { return Block; }
113 
114 protected:
115  virtual void recordInliningImpl() {}
117  virtual void recordUnsuccessfulInliningImpl(const InlineResult &Result) {}
119 
121  /// Caller and Callee are pre-inlining.
122  Function *const Caller;
123  Function *const Callee;
124 
125  // Capture the context of CB before inlining, as a successful inlining may
126  // change that context, and we want to report success or failure in the
127  // original context.
128  const DebugLoc DLoc;
129  const BasicBlock *const Block;
132 
133 private:
134  void markRecorded() {
135  assert(!Recorded && "Recording should happen exactly once");
136  Recorded = true;
137  }
138  void recordInlineStatsIfNeeded();
139 
140  bool Recorded = false;
141 };
142 
144 public:
147  bool EmitRemarks = true)
148  : InlineAdvice(Advisor, CB, ORE, OIC.has_value()), OriginalCB(&CB),
149  OIC(OIC), EmitRemarks(EmitRemarks) {}
150 
151 private:
152  void recordUnsuccessfulInliningImpl(const InlineResult &Result) override;
153  void recordInliningWithCalleeDeletedImpl() override;
154  void recordInliningImpl() override;
155 
156 private:
157  CallBase *const OriginalCB;
159  bool EmitRemarks;
160 };
161 
162 /// Interface for deciding whether to inline a call site or not.
164 public:
165  InlineAdvisor(InlineAdvisor &&) = delete;
166  virtual ~InlineAdvisor();
167 
168  /// Get an InlineAdvice containing a recommendation on whether to
169  /// inline or not. \p CB is assumed to be a direct call. \p FAM is assumed to
170  /// be up-to-date wrt previous inlining decisions. \p MandatoryOnly indicates
171  /// only mandatory (always-inline) call sites should be recommended - this
172  /// allows the InlineAdvisor track such inlininings.
173  /// Returns:
174  /// - An InlineAdvice with the inlining recommendation.
175  /// - Null when no recommendation is made (https://reviews.llvm.org/D110658).
176  /// TODO: Consider removing the Null return scenario by incorporating the
177  /// SampleProfile inliner into an InlineAdvisor
178  std::unique_ptr<InlineAdvice> getAdvice(CallBase &CB,
179  bool MandatoryOnly = false);
180 
181  /// This must be called when the Inliner pass is entered, to allow the
182  /// InlineAdvisor update internal state, as result of function passes run
183  /// between Inliner pass runs (for the same module).
184  virtual void onPassEntry(LazyCallGraph::SCC *SCC = nullptr) {}
185 
186  /// This must be called when the Inliner pass is exited, as function passes
187  /// may be run subsequently. This allows an implementation of InlineAdvisor
188  /// to prepare for a partial update, based on the optional SCC.
189  virtual void onPassExit(LazyCallGraph::SCC *SCC = nullptr) {}
190 
191  /// Support for printer pass
192  virtual void print(raw_ostream &OS) const {
193  OS << "Unimplemented InlineAdvisor print\n";
194  }
195 
196  /// NOTE pass name is annotated only when inline advisor constructor provides InlineContext.
197  const char *getAnnotatedInlinePassName() const {
198  return AnnotatedInlinePassName.c_str();
199  }
200 
201 protected:
204  virtual std::unique_ptr<InlineAdvice> getAdviceImpl(CallBase &CB) = 0;
205  virtual std::unique_ptr<InlineAdvice> getMandatoryAdvice(CallBase &CB,
206  bool Advice);
207 
211  const std::string AnnotatedInlinePassName;
212  std::unique_ptr<ImportedFunctionsInliningStatistics> ImportedFunctionsStats;
213 
215 
219 
221 
222 private:
223  friend class InlineAdvice;
224 };
225 
226 /// The default (manual heuristics) implementation of the InlineAdvisor. This
227 /// implementation does not need to keep state between inliner pass runs, and is
228 /// reusable as-is for inliner pass test scenarios, as well as for regular use.
230 public:
232  InlineParams Params, InlineContext IC)
233  : InlineAdvisor(M, FAM, IC), Params(Params) {}
234 
235 private:
236  std::unique_ptr<InlineAdvice> getAdviceImpl(CallBase &CB) override;
237 
238  InlineParams Params;
239 };
240 
241 /// The InlineAdvisorAnalysis is a module pass because the InlineAdvisor
242 /// needs to capture state right before inlining commences over a module.
243 class InlineAdvisorAnalysis : public AnalysisInfoMixin<InlineAdvisorAnalysis> {
244 public:
245  static AnalysisKey Key;
246  InlineAdvisorAnalysis() = default;
247  struct Result {
251  // Check whether the analysis has been explicitly invalidated. Otherwise,
252  // it's stateless and remains preserved.
253  auto PAC = PA.getChecker<InlineAdvisorAnalysis>();
254  return !PAC.preservedWhenStateless();
255  }
257  const ReplayInlinerSettings &ReplaySettings,
258  InlineContext IC);
259  InlineAdvisor *getAdvisor() const { return Advisor.get(); }
260 
261  private:
262  Module &M;
264  std::unique_ptr<InlineAdvisor> Advisor;
265  };
266 
268 };
269 
270 /// Printer pass for the FunctionPropertiesAnalysis results.
272  : public PassInfoMixin<InlineAdvisorAnalysisPrinterPass> {
273  raw_ostream &OS;
274 
275 public:
277 
279 
282 };
283 
284 std::unique_ptr<InlineAdvisor>
286 
287 std::unique_ptr<InlineAdvisor>
289  std::function<bool(CallBase &)> GetDefaultAdvice);
290 
291 // Default (manual policy) decision making helper APIs. Shared with the legacy
292 // pass manager inliner.
293 
294 /// Return the cost only if the inliner should attempt to inline at the given
295 /// CallSite. If we return the cost, we will emit an optimisation remark later
296 /// using that cost, so we won't do so from this function. Return None if
297 /// inlining should not be attempted.
298 Optional<InlineCost>
299 shouldInline(CallBase &CB, function_ref<InlineCost(CallBase &CB)> GetInlineCost,
300  OptimizationRemarkEmitter &ORE, bool EnableDeferral = true);
301 
302 /// Emit ORE message.
303 void emitInlinedInto(OptimizationRemarkEmitter &ORE, DebugLoc DLoc,
304  const BasicBlock *Block, const Function &Callee,
305  const Function &Caller, bool IsMandatory,
306  function_ref<void(OptimizationRemark &)> ExtraContext = {},
307  const char *PassName = nullptr);
308 
309 /// Emit ORE message based in cost (default heuristic).
310 void emitInlinedIntoBasedOnCost(OptimizationRemarkEmitter &ORE, DebugLoc DLoc,
311  const BasicBlock *Block, const Function &Callee,
312  const Function &Caller, const InlineCost &IC,
313  bool ForProfileContext = false,
314  const char *PassName = nullptr);
315 
316 /// Add location info to ORE message.
317 void addLocationToRemarks(OptimizationRemark &Remark, DebugLoc DLoc);
318 
319 /// Set the inline-remark attribute.
320 void setInlineRemark(CallBase &CB, StringRef Message);
321 
322 /// Utility for extracting the inline cost message to a string.
323 std::string inlineCostStr(const InlineCost &IC);
324 } // namespace llvm
325 #endif // LLVM_ANALYSIS_INLINEADVISOR_H
llvm::InlinePass::AlwaysInliner
@ AlwaysInliner
llvm::InlineAdvisor::print
virtual void print(raw_ostream &OS) const
Support for printer pass.
Definition: InlineAdvisor.h:192
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:152
llvm::InlineAdvisor::onPassEntry
virtual void onPassEntry(LazyCallGraph::SCC *SCC=nullptr)
This must be called when the Inliner pass is entered, to allow the InlineAdvisor update internal stat...
Definition: InlineAdvisor.h:184
llvm::InlineAdvice::recordInlining
void recordInlining()
Exactly one of the record* APIs must be called.
Definition: InlineAdvisor.cpp:184
llvm::InlineAdvisorAnalysis::Result::getAdvisor
InlineAdvisor * getAdvisor() const
Definition: InlineAdvisor.h:259
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::getReleaseModeAdvisor
std::unique_ptr< InlineAdvisor > getReleaseModeAdvisor(Module &M, ModuleAnalysisManager &MAM)
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::InlineAdvisor::ImportedFunctionsStats
std::unique_ptr< ImportedFunctionsInliningStatistics > ImportedFunctionsStats
Definition: InlineAdvisor.h:212
llvm::InlineAdvisor::M
Module & M
Definition: InlineAdvisor.h:208
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:371
llvm::Function
Definition: Function.h:60
llvm::InlinePass::EarlyInliner
@ EarlyInliner
llvm::InlineAdvisorAnalysis::run
Result run(Module &M, ModuleAnalysisManager &MAM)
Definition: InlineAdvisor.h:267
llvm::InlineAdvisorAnalysisPrinterPass::run
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM)
Definition: InlineAdvisor.cpp:620
llvm::InlineAdvice::Caller
Function *const Caller
Caller and Callee are pre-inlining.
Definition: InlineAdvisor.h:122
llvm::emitInlinedIntoBasedOnCost
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:500
llvm::InlineAdvice::~InlineAdvice
virtual ~InlineAdvice()
Definition: InlineAdvisor.h:81
llvm::InlineAdvisorAnalysisPrinterPass::InlineAdvisorAnalysisPrinterPass
InlineAdvisorAnalysisPrinterPass(raw_ostream &OS)
Definition: InlineAdvisor.h:276
llvm::ModuleAnalysisManager
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition: PassManager.h:913
llvm::Optional
Definition: APInt.h:33
llvm::InlineParams
Thresholds to tune inline cost analysis.
Definition: InlineCost.h:190
llvm::InlineAdvisor::MandatoryInliningKind::Always
@ Always
llvm::InlineAdvisor::MandatoryInliningKind::Never
@ Never
llvm::DefaultInlineAdvice
Definition: InlineAdvisor.h:143
llvm::addLocationToRemarks
void addLocationToRemarks(OptimizationRemark &Remark, DebugLoc DLoc)
Add location info to ORE message.
Definition: InlineAdvisor.cpp:456
llvm::InlineAdvisor::getCallerORE
OptimizationRemarkEmitter & getCallerORE(CallBase &CB)
Definition: InlineAdvisor.cpp:615
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:55
llvm::InlineAdvisorAnalysisPrinterPass
Printer pass for the FunctionPropertiesAnalysis results.
Definition: InlineAdvisor.h:271
llvm::ThinOrFullLTOPhase
ThinOrFullLTOPhase
This enumerates the LLVM full LTO or ThinLTO optimization phases.
Definition: Pass.h:73
llvm::emitInlinedInto
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:482
llvm::InlineAdvice::IsInliningRecommended
const bool IsInliningRecommended
Definition: InlineAdvisor.h:131
llvm::LazyCallGraph::SCC
An SCC of the call graph.
Definition: LazyCallGraph.h:419
llvm::InlineAdvisor::onPassExit
virtual void onPassExit(LazyCallGraph::SCC *SCC=nullptr)
This must be called when the Inliner pass is exited, as function passes may be run subsequently.
Definition: InlineAdvisor.h:189
llvm::InlineAdvice::ORE
OptimizationRemarkEmitter & ORE
Definition: InlineAdvisor.h:130
llvm::DefaultInlineAdvisor
The default (manual heuristics) implementation of the InlineAdvisor.
Definition: InlineAdvisor.h:229
int
Clang compiles this i1 i64 store i64 i64 store i64 i64 store i64 i64 store i64 align Which gets codegen d xmm0 movaps rbp movaps rbp movaps rbp movaps rbp rbp rbp rbp rbp It would be better to have movq s of instead of the movaps s LLVM produces ret int
Definition: README.txt:536
MAM
ModuleAnalysisManager MAM
Definition: PassBuilderBindings.cpp:61
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::InlineAdvice::getOriginalCallSiteBasicBlock
const BasicBlock * getOriginalCallSiteBasicBlock() const
Definition: InlineAdvisor.h:112
llvm::AnalysisManager::Invalidator
API to communicate dependencies between analyses during invalidation.
Definition: PassManager.h:667
LazyCallGraph.h
llvm::InlineContext
Provides context on when an inline advisor is constructed in the pipeline (e.g., link phase,...
Definition: InlineAdvisor.h:58
llvm::InlineAdvisor::MandatoryInliningKind
MandatoryInliningKind
Definition: InlineAdvisor.h:214
llvm::InlineAdvisorAnalysis::Result
Definition: InlineAdvisor.h:247
llvm::InlineAdvice
Capture state between an inlining decision having had been made, and its impact being observable.
Definition: InlineAdvisor.h:74
llvm::InliningAdvisorMode
InliningAdvisorMode
There are 3 scenarios we can use the InlineAdvisor:
Definition: InlineAdvisor.h:42
llvm::InlineAdvisor::getAnnotatedInlinePassName
const char * getAnnotatedInlinePassName() const
NOTE pass name is annotated only when inline advisor constructor provides InlineContext.
Definition: InlineAdvisor.h:197
llvm::InlineAdvisor::InlineAdvisor
InlineAdvisor(InlineAdvisor &&)=delete
llvm::InlineAdvice::recordUnattemptedInlining
void recordUnattemptedInlining()
Call to indicate inlining was not attempted.
Definition: InlineAdvisor.h:104
llvm::NoneType::None
@ None
llvm::InlineAdvice::recordInliningWithCalleeDeleted
void recordInliningWithCalleeDeleted()
Call after inlining succeeded, and results in the callee being delete-able, meaning,...
Definition: InlineAdvisor.cpp:190
CGSCCPassManager.h
llvm::AnalysisKey
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: PassManager.h:69
llvm::InlineAdvisor::IC
const Optional< InlineContext > IC
Definition: InlineAdvisor.h:210
llvm::InlinePass::MLInliner
@ MLInliner
llvm::InlineAdvice::Block
const BasicBlock *const Block
Definition: InlineAdvisor.h:129
llvm::InlineAdvice::recordInliningImpl
virtual void recordInliningImpl()
Definition: InlineAdvisor.h:115
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::setInlineRemark
void setInlineRemark(CallBase &CB, StringRef Message)
Set the inline-remark attribute.
Definition: InlineAdvisor.cpp:355
llvm::InlineAdvice::DLoc
const DebugLoc DLoc
Definition: InlineAdvisor.h:128
InlineCost.h
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition: ISDOpcodes.h:71
llvm::InlinePass::CGSCCInliner
@ CGSCCInliner
Mode
SI Whole Quad Mode
Definition: SIWholeQuadMode.cpp:262
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:82
llvm::InliningAdvisorMode::Development
@ Development
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::AnalysisInfoMixin
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition: PassManager.h:394
llvm::InlineContext::Pass
InlinePass Pass
Definition: InlineAdvisor.h:61
llvm::InlineAdvice::recordUnsuccessfulInliningImpl
virtual void recordUnsuccessfulInliningImpl(const InlineResult &Result)
Definition: InlineAdvisor.h:117
llvm::InlineAdvice::isInliningRecommended
bool isInliningRecommended() const
Get the inlining recommendation.
Definition: InlineAdvisor.h:110
llvm::AMDGPU::CPol::SCC
@ SCC
Definition: SIDefines.h:304
llvm::InlineAdvisor::MandatoryInliningKind::NotMandatory
@ NotMandatory
llvm::InlineAdvisorAnalysis::Result::tryCreate
bool tryCreate(InlineParams Params, InliningAdvisorMode Mode, const ReplayInlinerSettings &ReplaySettings, InlineContext IC)
Definition: InlineAdvisor.cpp:198
llvm::InlineAdvisorAnalysis::Result::Result
Result(Module &M, ModuleAnalysisManager &MAM)
Definition: InlineAdvisor.h:248
llvm::OptimizationRemarkEmitter
The optimization diagnostic interface.
Definition: OptimizationRemarkEmitter.h:33
llvm::DefaultInlineAdvisor::DefaultInlineAdvisor
DefaultInlineAdvisor(Module &M, FunctionAnalysisManager &FAM, InlineParams Params, InlineContext IC)
Definition: InlineAdvisor.h:231
llvm::InlineAdvisor
Interface for deciding whether to inline a call site or not.
Definition: InlineAdvisor.h:163
llvm::InlineAdvisorAnalysis::InlineAdvisorAnalysis
InlineAdvisorAnalysis()=default
llvm::InlineAdvice::recordUnattemptedInliningImpl
virtual void recordUnattemptedInliningImpl()
Definition: InlineAdvisor.h:118
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::InlineAdvice::recordInliningWithCalleeDeletedImpl
virtual void recordInliningWithCalleeDeletedImpl()
Definition: InlineAdvisor.h:116
llvm::InlinePass::ReplaySampleProfileInliner
@ ReplaySampleProfileInliner
llvm::InlineAdvisor::getMandatoryAdvice
virtual std::unique_ptr< InlineAdvice > getMandatoryAdvice(CallBase &CB, bool Advice)
Definition: InlineAdvisor.cpp:534
llvm::CGSCCUpdateResult
Support structure for SCC passes to communicate updates the call graph back to the CGSCC pass manager...
Definition: CGSCCPassManager.h:232
llvm::InlineAdvisor::FAM
FunctionAnalysisManager & FAM
Definition: InlineAdvisor.h:209
llvm::InlinePass::ModuleInliner
@ ModuleInliner
llvm::InlineAdvisor::getAdvice
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:605
llvm::InlinePass
InlinePass
Definition: InlineAdvisor.h:45
llvm::InlineAdvisor::getAdviceImpl
virtual std::unique_ptr< InlineAdvice > getAdviceImpl(CallBase &CB)=0
PassManager.h
llvm::inlineCostStr
std::string inlineCostStr(const InlineCost &IC)
Utility for extracting the inline cost message to a string.
Definition: InlineAdvisor.cpp:348
llvm::InlinePass::SampleProfileInliner
@ SampleProfileInliner
llvm::InlineAdvisor::getMandatoryKind
static MandatoryInliningKind getMandatoryKind(CallBase &CB, FunctionAnalysisManager &FAM, OptimizationRemarkEmitter &ORE)
Definition: InlineAdvisor.cpp:583
llvm::AnnotateInlinePassName
std::string AnnotateInlinePassName(InlineContext IC)
Definition: InlineAdvisor.cpp:577
llvm::InlineAdvisorAnalysis
The InlineAdvisorAnalysis is a module pass because the InlineAdvisor needs to capture state right bef...
Definition: InlineAdvisor.h:243
llvm::InlineAdvisorAnalysis::Key
static AnalysisKey Key
Definition: InlineAdvisor.h:245
llvm::InliningAdvisorMode::Default
@ Default
llvm::getDevelopmentModeAdvisor
std::unique_ptr< InlineAdvisor > getDevelopmentModeAdvisor(Module &M, ModuleAnalysisManager &MAM, std::function< bool(CallBase &)> GetDefaultAdvice)
llvm::InlineAdvice::InlineAdvice
InlineAdvice(InlineAdvisor *Advisor, CallBase &CB, OptimizationRemarkEmitter &ORE, bool IsInliningRecommended)
Definition: InlineAdvisor.cpp:172
llvm::CallBase
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Definition: InstrTypes.h:1174
llvm::InlineAdvisor::AnnotatedInlinePassName
const std::string AnnotatedInlinePassName
Definition: InlineAdvisor.h:211
llvm::PreservedAnalyses::getChecker
PreservedAnalysisChecker getChecker() const
Build a checker for this PreservedAnalyses and the specified analysis type.
Definition: PassManager.h:310
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:42
llvm::InliningAdvisorMode::Release
@ Release
llvm::DefaultInlineAdvice::DefaultInlineAdvice
DefaultInlineAdvice(InlineAdvisor *Advisor, CallBase &CB, Optional< InlineCost > OIC, OptimizationRemarkEmitter &ORE, bool EmitRemarks=true)
Definition: InlineAdvisor.h:145
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::LazyCallGraph
A lazily constructed view of the call graph of a module.
Definition: LazyCallGraph.h:110
llvm::InlineAdvice::getOriginalCallSiteDebugLoc
const DebugLoc & getOriginalCallSiteDebugLoc() const
Definition: InlineAdvisor.h:111
llvm::InlineAdvice::Advisor
InlineAdvisor *const Advisor
Definition: InlineAdvisor.h:120
llvm::InlineResult
InlineResult is basically true or false.
Definition: InlineCost.h:164
llvm::InlineAdvice::Callee
Function *const Callee
Definition: InlineAdvisor.h:123
llvm::ReplayInlinerSettings
Replay Inliner Setup.
Definition: ReplayInlineAdvisor.h:43
llvm::InlineAdvice::recordUnsuccessfulInlining
void recordUnsuccessfulInlining(const InlineResult &Result)
Call after the decision for a call site was to not inline.
Definition: InlineAdvisor.h:98
llvm::InlineAdvisor::~InlineAdvisor
virtual ~InlineAdvisor()
Definition: InlineAdvisor.cpp:526
PassName
static const char PassName[]
Definition: X86LowerAMXIntrinsics.cpp:671
llvm::InlinePass::ReplayCGSCCInliner
@ ReplayCGSCCInliner
llvm::codeview::PublicSymFlags::Function
@ Function
llvm::shouldInline
Optional< InlineCost > shouldInline(CallBase &CB, 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:368
llvm::InlineAdvisorAnalysis::Result::invalidate
bool invalidate(Module &, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &)
Definition: InlineAdvisor.h:249
llvm::InlineContext::LTOPhase
ThinOrFullLTOPhase LTOPhase
Definition: InlineAdvisor.h:59