13 #ifndef LLVM_TRANSFORMS_INSTRUMENTATION_H 14 #define LLVM_TRANSFORMS_INSTRUMENTATION_H 29 class OptimizationRemarkEmitter;
43 const char *NamePrefix =
"");
49 const std::string &ModuleId);
99 bool SamplePGO =
false);
124 bool AttachProfToDirectCall,
134 bool DoCounterPromotion =
false;
140 bool UseBFIInPromotion =
false;
157 const std::vector<std::string> &ABIListFiles = std::vector<std::string>(),
158 void *(*getArgTLS)() =
nullptr,
void *(*getRetValTLS)() =
nullptr);
167 } CoverageType = SCK_None;
168 bool IndirectCalls =
false;
169 bool TraceBB =
false;
170 bool TraceCmp =
false;
171 bool TraceDiv =
false;
172 bool TraceGep =
false;
173 bool Use8bitCounters =
false;
174 bool TracePC =
false;
175 bool TracePCGuard =
false;
176 bool Inline8bitCounters =
false;
177 bool PCTable =
false;
178 bool NoPrune =
false;
179 bool StackDepth =
false;
199 uint64_t
Scaled = Count / Scale;
205 #endif // LLVM_TRANSFORMS_INSTRUMENTATION_H ModulePass * createPGOInstrumentationGenLegacyPass(bool IsCS=false)
This class represents lattice values for constants.
ModulePass * createGCOVProfilerPass(const GCOVOptions &Options=GCOVOptions::getDefault())
FunctionPass * createPGOMemOPSizeOptLegacyPass()
static GCOVOptions getDefault()
ModulePass * createPGOInstrumentationGenCreateVarLegacyPass(StringRef CSInstrName=StringRef(""))
ModulePass * createInstrProfilingLegacyPass(const InstrProfOptions &Options=InstrProfOptions(), bool IsCS=false)
Insert frontend instrumentation based profiling. Parameter IsCS indicates if.
ModulePass * createInstrOrderFilePass()
Instruction * promoteIndirectCall(Instruction *Inst, Function *F, uint64_t Count, uint64_t TotalCount, bool AttachProfToDirectCall, OptimizationRemarkEmitter *ORE)
FunctionPass class - This class is used to implement most global optimizations.
static uint64_t calculateCountScale(uint64_t MaxCount)
Calculate what to divide by to scale counts.
static uint32_t scaleBranchCount(uint64_t Count, uint64_t Scale)
Scale an individual branch count.
std::string InstrProfileOutput
Align max(MaybeAlign Lhs, Align Rhs)
GlobalVariable * createPrivateGlobalForString(Module &M, StringRef Str, bool AllowMerging, const char *NamePrefix="")
BasicBlock::iterator PrepareToSplitEntryBlock(BasicBlock &BB, BasicBlock::iterator IP)
Instrumentation passes often insert conditional checks into entry blocks.
ModulePass * createPGOInstrumentationUseLegacyPass(StringRef Filename=StringRef(""), bool IsCS=false)
Comdat * GetOrCreateFunctionComdat(Function &F, Triple &T, const std::string &ModuleId)
Options for the frontend instrumentation based profiling pass.
InstListType::iterator iterator
Instruction iterators...
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ModulePass * createDataFlowSanitizerPass(const std::vector< std::string > &ABIListFiles=std::vector< std::string >(), void *(*getArgTLS)()=nullptr, void *(*getRetValTLS)()=nullptr)
StringRef - Represent a constant reference to a string, i.e.
ModulePass * createPGOIndirectCallPromotionLegacyPass(bool InLTO=false, bool SamplePGO=false)