LLVM  9.0.0svn
IndirectCallPromotion.cpp
Go to the documentation of this file.
1 //===- IndirectCallPromotion.cpp - Optimizations based on value profiling -===//
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 // This file implements the transformation that promotes indirect calls to
10 // conditional direct calls when the indirect-call value profile metadata is
11 // available.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #include "llvm/ADT/ArrayRef.h"
16 #include "llvm/ADT/STLExtras.h"
17 #include "llvm/ADT/SmallVector.h"
18 #include "llvm/ADT/Statistic.h"
19 #include "llvm/ADT/StringRef.h"
24 #include "llvm/IR/Attributes.h"
25 #include "llvm/IR/BasicBlock.h"
26 #include "llvm/IR/CallSite.h"
27 #include "llvm/IR/DerivedTypes.h"
28 #include "llvm/IR/DiagnosticInfo.h"
29 #include "llvm/IR/Function.h"
30 #include "llvm/IR/IRBuilder.h"
31 #include "llvm/IR/InstrTypes.h"
32 #include "llvm/IR/Instruction.h"
33 #include "llvm/IR/Instructions.h"
34 #include "llvm/IR/LLVMContext.h"
35 #include "llvm/IR/MDBuilder.h"
36 #include "llvm/IR/PassManager.h"
37 #include "llvm/IR/Type.h"
38 #include "llvm/IR/Value.h"
39 #include "llvm/Pass.h"
41 #include "llvm/Support/Casting.h"
43 #include "llvm/Support/Debug.h"
44 #include "llvm/Support/Error.h"
50 #include <cassert>
51 #include <cstdint>
52 #include <memory>
53 #include <string>
54 #include <utility>
55 #include <vector>
56 
57 using namespace llvm;
58 
59 #define DEBUG_TYPE "pgo-icall-prom"
60 
61 STATISTIC(NumOfPGOICallPromotion, "Number of indirect call promotions.");
62 STATISTIC(NumOfPGOICallsites, "Number of indirect call candidate sites.");
63 
64 // Command line option to disable indirect-call promotion with the default as
65 // false. This is for debug purpose.
66 static cl::opt<bool> DisableICP("disable-icp", cl::init(false), cl::Hidden,
67  cl::desc("Disable indirect call promotion"));
68 
69 // Set the cutoff value for the promotion. If the value is other than 0, we
70 // stop the transformation once the total number of promotions equals the cutoff
71 // value.
72 // For debug use only.
73 static cl::opt<unsigned>
74  ICPCutOff("icp-cutoff", cl::init(0), cl::Hidden, cl::ZeroOrMore,
75  cl::desc("Max number of promotions for this compilation"));
76 
77 // If ICPCSSkip is non zero, the first ICPCSSkip callsites will be skipped.
78 // For debug use only.
79 static cl::opt<unsigned>
80  ICPCSSkip("icp-csskip", cl::init(0), cl::Hidden, cl::ZeroOrMore,
81  cl::desc("Skip Callsite up to this number for this compilation"));
82 
83 // Set if the pass is called in LTO optimization. The difference for LTO mode
84 // is the pass won't prefix the source module name to the internal linkage
85 // symbols.
86 static cl::opt<bool> ICPLTOMode("icp-lto", cl::init(false), cl::Hidden,
87  cl::desc("Run indirect-call promotion in LTO "
88  "mode"));
89 
90 // Set if the pass is called in SamplePGO mode. The difference for SamplePGO
91 // mode is it will add prof metadatato the created direct call.
92 static cl::opt<bool>
93  ICPSamplePGOMode("icp-samplepgo", cl::init(false), cl::Hidden,
94  cl::desc("Run indirect-call promotion in SamplePGO mode"));
95 
96 // If the option is set to true, only call instructions will be considered for
97 // transformation -- invoke instructions will be ignored.
98 static cl::opt<bool>
99  ICPCallOnly("icp-call-only", cl::init(false), cl::Hidden,
100  cl::desc("Run indirect-call promotion for call instructions "
101  "only"));
102 
103 // If the option is set to true, only invoke instructions will be considered for
104 // transformation -- call instructions will be ignored.
105 static cl::opt<bool> ICPInvokeOnly("icp-invoke-only", cl::init(false),
106  cl::Hidden,
107  cl::desc("Run indirect-call promotion for "
108  "invoke instruction only"));
109 
110 // Dump the function level IR if the transformation happened in this
111 // function. For debug use only.
112 static cl::opt<bool>
113  ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden,
114  cl::desc("Dump IR after transformation happens"));
115 
116 namespace {
117 
118 class PGOIndirectCallPromotionLegacyPass : public ModulePass {
119 public:
120  static char ID;
121 
122  PGOIndirectCallPromotionLegacyPass(bool InLTO = false, bool SamplePGO = false)
123  : ModulePass(ID), InLTO(InLTO), SamplePGO(SamplePGO) {
126  }
127 
128  void getAnalysisUsage(AnalysisUsage &AU) const override {
130  }
131 
132  StringRef getPassName() const override { return "PGOIndirectCallPromotion"; }
133 
134 private:
135  bool runOnModule(Module &M) override;
136 
137  // If this pass is called in LTO. We need to special handling the PGOFuncName
138  // for the static variables due to LTO's internalization.
139  bool InLTO;
140 
141  // If this pass is called in SamplePGO. We need to add the prof metadata to
142  // the promoted direct call.
143  bool SamplePGO;
144 };
145 
146 } // end anonymous namespace
147 
149 
150 INITIALIZE_PASS_BEGIN(PGOIndirectCallPromotionLegacyPass, "pgo-icall-prom",
151  "Use PGO instrumentation profile to promote indirect "
152  "calls to direct calls.",
153  false, false)
155 INITIALIZE_PASS_END(PGOIndirectCallPromotionLegacyPass, "pgo-icall-prom",
156  "Use PGO instrumentation profile to promote indirect "
157  "calls to direct calls.",
158  false, false)
159 
161  bool SamplePGO) {
162  return new PGOIndirectCallPromotionLegacyPass(InLTO, SamplePGO);
163 }
164 
165 namespace {
166 
167 // The class for main data structure to promote indirect calls to conditional
168 // direct calls.
169 class ICallPromotionFunc {
170 private:
171  Function &F;
172  Module *M;
173 
174  // Symtab that maps indirect call profile values to function names and
175  // defines.
176  InstrProfSymtab *Symtab;
177 
178  bool SamplePGO;
179 
181 
182  // A struct that records the direct target and it's call count.
183  struct PromotionCandidate {
184  Function *TargetFunction;
185  uint64_t Count;
186 
187  PromotionCandidate(Function *F, uint64_t C) : TargetFunction(F), Count(C) {}
188  };
189 
190  // Check if the indirect-call call site should be promoted. Return the number
191  // of promotions. Inst is the candidate indirect call, ValueDataRef
192  // contains the array of value profile data for profiled targets,
193  // TotalCount is the total profiled count of call executions, and
194  // NumCandidates is the number of candidate entries in ValueDataRef.
195  std::vector<PromotionCandidate> getPromotionCandidatesForCallSite(
196  Instruction *Inst, const ArrayRef<InstrProfValueData> &ValueDataRef,
197  uint64_t TotalCount, uint32_t NumCandidates);
198 
199  // Promote a list of targets for one indirect-call callsite. Return
200  // the number of promotions.
201  uint32_t tryToPromote(Instruction *Inst,
202  const std::vector<PromotionCandidate> &Candidates,
203  uint64_t &TotalCount);
204 
205 public:
206  ICallPromotionFunc(Function &Func, Module *Modu, InstrProfSymtab *Symtab,
207  bool SamplePGO, OptimizationRemarkEmitter &ORE)
208  : F(Func), M(Modu), Symtab(Symtab), SamplePGO(SamplePGO), ORE(ORE) {}
209  ICallPromotionFunc(const ICallPromotionFunc &) = delete;
210  ICallPromotionFunc &operator=(const ICallPromotionFunc &) = delete;
211 
212  bool processFunction(ProfileSummaryInfo *PSI);
213 };
214 
215 } // end anonymous namespace
216 
217 // Indirect-call promotion heuristic. The direct targets are sorted based on
218 // the count. Stop at the first target that is not promoted.
219 std::vector<ICallPromotionFunc::PromotionCandidate>
220 ICallPromotionFunc::getPromotionCandidatesForCallSite(
221  Instruction *Inst, const ArrayRef<InstrProfValueData> &ValueDataRef,
222  uint64_t TotalCount, uint32_t NumCandidates) {
223  std::vector<PromotionCandidate> Ret;
224 
225  LLVM_DEBUG(dbgs() << " \nWork on callsite #" << NumOfPGOICallsites << *Inst
226  << " Num_targets: " << ValueDataRef.size()
227  << " Num_candidates: " << NumCandidates << "\n");
228  NumOfPGOICallsites++;
229  if (ICPCSSkip != 0 && NumOfPGOICallsites <= ICPCSSkip) {
230  LLVM_DEBUG(dbgs() << " Skip: User options.\n");
231  return Ret;
232  }
233 
234  for (uint32_t I = 0; I < NumCandidates; I++) {
235  uint64_t Count = ValueDataRef[I].Count;
236  assert(Count <= TotalCount);
237  uint64_t Target = ValueDataRef[I].Value;
238  LLVM_DEBUG(dbgs() << " Candidate " << I << " Count=" << Count
239  << " Target_func: " << Target << "\n");
240 
241  if (ICPInvokeOnly && isa<CallInst>(Inst)) {
242  LLVM_DEBUG(dbgs() << " Not promote: User options.\n");
243  ORE.emit([&]() {
244  return OptimizationRemarkMissed(DEBUG_TYPE, "UserOptions", Inst)
245  << " Not promote: User options";
246  });
247  break;
248  }
249  if (ICPCallOnly && isa<InvokeInst>(Inst)) {
250  LLVM_DEBUG(dbgs() << " Not promote: User option.\n");
251  ORE.emit([&]() {
252  return OptimizationRemarkMissed(DEBUG_TYPE, "UserOptions", Inst)
253  << " Not promote: User options";
254  });
255  break;
256  }
257  if (ICPCutOff != 0 && NumOfPGOICallPromotion >= ICPCutOff) {
258  LLVM_DEBUG(dbgs() << " Not promote: Cutoff reached.\n");
259  ORE.emit([&]() {
260  return OptimizationRemarkMissed(DEBUG_TYPE, "CutOffReached", Inst)
261  << " Not promote: Cutoff reached";
262  });
263  break;
264  }
265 
266  Function *TargetFunction = Symtab->getFunction(Target);
267  if (TargetFunction == nullptr) {
268  LLVM_DEBUG(dbgs() << " Not promote: Cannot find the target\n");
269  ORE.emit([&]() {
270  return OptimizationRemarkMissed(DEBUG_TYPE, "UnableToFindTarget", Inst)
271  << "Cannot promote indirect call: target with md5sum "
272  << ore::NV("target md5sum", Target) << " not found";
273  });
274  break;
275  }
276 
277  const char *Reason = nullptr;
278  if (!isLegalToPromote(CallSite(Inst), TargetFunction, &Reason)) {
279  using namespace ore;
280 
281  ORE.emit([&]() {
282  return OptimizationRemarkMissed(DEBUG_TYPE, "UnableToPromote", Inst)
283  << "Cannot promote indirect call to "
284  << NV("TargetFunction", TargetFunction) << " with count of "
285  << NV("Count", Count) << ": " << Reason;
286  });
287  break;
288  }
289 
290  Ret.push_back(PromotionCandidate(TargetFunction, Count));
291  TotalCount -= Count;
292  }
293  return Ret;
294 }
295 
297  Function *DirectCallee,
298  uint64_t Count, uint64_t TotalCount,
299  bool AttachProfToDirectCall,
301 
302  uint64_t ElseCount = TotalCount - Count;
303  uint64_t MaxCount = (Count >= ElseCount ? Count : ElseCount);
304  uint64_t Scale = calculateCountScale(MaxCount);
305  MDBuilder MDB(Inst->getContext());
306  MDNode *BranchWeights = MDB.createBranchWeights(
307  scaleBranchCount(Count, Scale), scaleBranchCount(ElseCount, Scale));
308 
309  Instruction *NewInst =
310  promoteCallWithIfThenElse(CallSite(Inst), DirectCallee, BranchWeights);
311 
312  if (AttachProfToDirectCall) {
313  MDBuilder MDB(NewInst->getContext());
314  NewInst->setMetadata(
316  MDB.createBranchWeights({static_cast<uint32_t>(Count)}));
317  }
318 
319  using namespace ore;
320 
321  if (ORE)
322  ORE->emit([&]() {
323  return OptimizationRemark(DEBUG_TYPE, "Promoted", Inst)
324  << "Promote indirect call to " << NV("DirectCallee", DirectCallee)
325  << " with count " << NV("Count", Count) << " out of "
326  << NV("TotalCount", TotalCount);
327  });
328  return NewInst;
329 }
330 
331 // Promote indirect-call to conditional direct-call for one callsite.
332 uint32_t ICallPromotionFunc::tryToPromote(
333  Instruction *Inst, const std::vector<PromotionCandidate> &Candidates,
334  uint64_t &TotalCount) {
335  uint32_t NumPromoted = 0;
336 
337  for (auto &C : Candidates) {
338  uint64_t Count = C.Count;
339  pgo::promoteIndirectCall(Inst, C.TargetFunction, Count, TotalCount,
340  SamplePGO, &ORE);
341  assert(TotalCount >= Count);
342  TotalCount -= Count;
343  NumOfPGOICallPromotion++;
344  NumPromoted++;
345  }
346  return NumPromoted;
347 }
348 
349 // Traverse all the indirect-call callsite and get the value profile
350 // annotation to perform indirect-call promotion.
351 bool ICallPromotionFunc::processFunction(ProfileSummaryInfo *PSI) {
352  bool Changed = false;
353  ICallPromotionAnalysis ICallAnalysis;
354  for (auto &I : findIndirectCalls(F)) {
355  uint32_t NumVals, NumCandidates;
356  uint64_t TotalCount;
357  auto ICallProfDataRef = ICallAnalysis.getPromotionCandidatesForInstruction(
358  I, NumVals, TotalCount, NumCandidates);
359  if (!NumCandidates ||
360  (PSI && PSI->hasProfileSummary() && !PSI->isHotCount(TotalCount)))
361  continue;
362  auto PromotionCandidates = getPromotionCandidatesForCallSite(
363  I, ICallProfDataRef, TotalCount, NumCandidates);
364  uint32_t NumPromoted = tryToPromote(I, PromotionCandidates, TotalCount);
365  if (NumPromoted == 0)
366  continue;
367 
368  Changed = true;
369  // Adjust the MD.prof metadata. First delete the old one.
370  I->setMetadata(LLVMContext::MD_prof, nullptr);
371  // If all promoted, we don't need the MD.prof metadata.
372  if (TotalCount == 0 || NumPromoted == NumVals)
373  continue;
374  // Otherwise we need update with the un-promoted records back.
375  annotateValueSite(*M, *I, ICallProfDataRef.slice(NumPromoted), TotalCount,
376  IPVK_IndirectCallTarget, NumCandidates);
377  }
378  return Changed;
379 }
380 
381 // A wrapper function that does the actual work.
383  bool InLTO, bool SamplePGO,
384  ModuleAnalysisManager *AM = nullptr) {
385  if (DisableICP)
386  return false;
387  InstrProfSymtab Symtab;
388  if (Error E = Symtab.create(M, InLTO)) {
389  std::string SymtabFailure = toString(std::move(E));
390  LLVM_DEBUG(dbgs() << "Failed to create symtab: " << SymtabFailure << "\n");
391  (void)SymtabFailure;
392  return false;
393  }
394  bool Changed = false;
395  for (auto &F : M) {
396  if (F.isDeclaration() || F.hasOptNone())
397  continue;
398 
399  std::unique_ptr<OptimizationRemarkEmitter> OwnedORE;
401  if (AM) {
402  auto &FAM =
403  AM->getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
404  ORE = &FAM.getResult<OptimizationRemarkEmitterAnalysis>(F);
405  } else {
406  OwnedORE = llvm::make_unique<OptimizationRemarkEmitter>(&F);
407  ORE = OwnedORE.get();
408  }
409 
410  ICallPromotionFunc ICallPromotion(F, &M, &Symtab, SamplePGO, *ORE);
411  bool FuncChanged = ICallPromotion.processFunction(PSI);
412  if (ICPDUMPAFTER && FuncChanged) {
413  LLVM_DEBUG(dbgs() << "\n== IR Dump After =="; F.print(dbgs()));
414  LLVM_DEBUG(dbgs() << "\n");
415  }
416  Changed |= FuncChanged;
417  if (ICPCutOff != 0 && NumOfPGOICallPromotion >= ICPCutOff) {
418  LLVM_DEBUG(dbgs() << " Stop: Cutoff reached.\n");
419  break;
420  }
421  }
422  return Changed;
423 }
424 
425 bool PGOIndirectCallPromotionLegacyPass::runOnModule(Module &M) {
426  ProfileSummaryInfo *PSI =
427  &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
428 
429  // Command-line option has the priority for InLTO.
430  return promoteIndirectCalls(M, PSI, InLTO | ICPLTOMode,
431  SamplePGO | ICPSamplePGOMode);
432 }
433 
435  ModuleAnalysisManager &AM) {
437 
438  if (!promoteIndirectCalls(M, PSI, InLTO | ICPLTOMode,
439  SamplePGO | ICPSamplePGOMode, &AM))
440  return PreservedAnalyses::all();
441 
442  return PreservedAnalyses::none();
443 }
const Function & getFunction() const
Definition: Function.h:133
ArrayRef< InstrProfValueData > getPromotionCandidatesForInstruction(const Instruction *I, uint32_t &NumVals, uint64_t &TotalCount, uint32_t &NumCandidates)
Returns reference to array of InstrProfValueData for the given instruction I.
uint64_t CallInst * C
static cl::opt< unsigned > ICPCSSkip("icp-csskip", cl::init(0), cl::Hidden, cl::ZeroOrMore, cl::desc("Skip Callsite up to this number for this compilation"))
A symbol table used for function PGO name look-up with keys (such as pointers, md5hash values) to the...
Definition: InstrProf.h:410
#define DEBUG_TYPE
Diagnostic information for missed-optimization remarks.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
DiagnosticInfoOptimizationBase::Argument NV
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Definition: PassManager.h:776
This class represents lattice values for constants.
Definition: AllocatorList.h:23
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:65
Analysis providing profile information.
LLVMContext & getContext() const
All values hold a context through their type.
Definition: Value.cpp:732
bool isLegalToPromote(CallSite CS, Function *Callee, const char **FailureReason=nullptr)
Return true if the given indirect call site can be made to call Callee.
STATISTIC(NumFunctions, "Total number of functions")
Metadata node.
Definition: Metadata.h:863
F(f)
bool isHotCount(uint64_t C)
Returns true if count C is considered hot.
static cl::opt< bool > DisableICP("disable-icp", cl::init(false), cl::Hidden, cl::desc("Disable indirect call promotion"))
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
Definition: PassSupport.h:50
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
std::string toString(Error E)
Write all error messages (if any) in E to a string.
Definition: Error.h:966
An analysis pass based on legacy pass manager to deliver ProfileSummaryInfo.
A Use represents the edge between a Value definition and its users.
Definition: Use.h:55
This file contains the simple types necessary to represent the attributes associated with functions a...
This file provides the interface for IR based instrumentation passes ( (profile-gen, and profile-use).
static bool promoteIndirectCalls(Module &M, ProfileSummaryInfo *PSI, bool InLTO, bool SamplePGO, ModuleAnalysisManager *AM=nullptr)
static cl::opt< bool > ICPLTOMode("icp-lto", cl::init(false), cl::Hidden, cl::desc("Run indirect-call promotion in LTO " "mode"))
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
Instruction * promoteIndirectCall(Instruction *Inst, Function *F, uint64_t Count, uint64_t TotalCount, bool AttachProfToDirectCall, OptimizationRemarkEmitter *ORE)
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
Definition: PassManager.h:156
Interface to identify indirect call promotion candidates.
bool hasProfileSummary()
Returns true if profile summary is available.
xray instrumentation
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:432
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:153
An analysis pass based on the new PM to deliver ProfileSummaryInfo.
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:148
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Diagnostic information for applied optimization remarks.
Represent the analysis usage information of a pass.
INITIALIZE_PASS_BEGIN(PGOIndirectCallPromotionLegacyPass, "pgo-icall-prom", "Use PGO instrumentation profile to promote indirect " "calls to direct calls.", false, false) INITIALIZE_PASS_END(PGOIndirectCallPromotionLegacyPass
static uint64_t calculateCountScale(uint64_t MaxCount)
Calculate what to divide by to scale counts.
pgo icall prom
static uint32_t scaleBranchCount(uint64_t Count, uint64_t Scale)
Scale an individual branch count.
void annotateValueSite(Module &M, Instruction &Inst, const InstrProfRecord &InstrProfR, InstrProfValueKind ValueKind, uint32_t SiteIndx, uint32_t MaxMDCount=3)
Get the value profile data for value site SiteIdx from InstrProfR and annotate the instruction Inst w...
Definition: InstrProf.cpp:931
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition: PassManager.h:159
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
void setMetadata(unsigned KindID, MDNode *Node)
Set the metadata of the specified kind to the specified node.
Definition: Metadata.cpp:1222
Error create(object::SectionRef &Section)
Create InstrProfSymtab from an object file section which contains function PGO names.
static cl::opt< bool > ICPSamplePGOMode("icp-samplepgo", cl::init(false), cl::Hidden, cl::desc("Run indirect-call promotion in SamplePGO mode"))
pgo icall Use PGO instrumentation profile to promote indirect calls to direct calls
void emit(DiagnosticInfoOptimizationBase &OptDiag)
Output the remark via the diagnostic handler and to the optimization record file. ...
Instruction * promoteCallWithIfThenElse(CallSite CS, Function *Callee, MDNode *BranchWeights=nullptr)
Promote the given indirect call site to conditionally call Callee.
void initializePGOIndirectCallPromotionLegacyPassPass(PassRegistry &)
static cl::opt< bool > ICPCallOnly("icp-call-only", cl::init(false), cl::Hidden, cl::desc("Run indirect-call promotion for call instructions " "only"))
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:132
Target - Wrapper for Target specific information.
static cl::opt< bool > ICPDUMPAFTER("icp-dumpafter", cl::init(false), cl::Hidden, cl::desc("Dump IR after transformation happens"))
pgo instr Read PGO instrumentation profile
std::vector< Instruction * > findIndirectCalls(Function &F)
static cl::opt< unsigned > ICPCutOff("icp-cutoff", cl::init(0), cl::Hidden, cl::ZeroOrMore, cl::desc("Max number of promotions for this compilation"))
static cl::opt< bool > ICPInvokeOnly("icp-invoke-only", cl::init(false), cl::Hidden, cl::desc("Run indirect-call promotion for " "invoke instruction only"))
#define I(x, y, z)
Definition: MD5.cpp:58
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:224
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.
#define LLVM_DEBUG(X)
Definition: Debug.h:122
ModulePass * createPGOIndirectCallPromotionLegacyPass(bool InLTO=false, bool SamplePGO=false)
The optimization diagnostic interface.
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
Definition: PassManager.h:1044