15#ifndef LLVM_TRANSFORMS_IPO_SAMPLEPROFILEPROBE_H
16#define LLVM_TRANSFORMS_IPO_SAMPLEPROFILEPROBE_H
22#include <unordered_map>
29class PassInstrumentationCallbacks;
34using namespace sampleprof;
35using BlockIdMap = std::unordered_map<BasicBlock *, uint32_t>;
39using ProbeFactorMap = std::unordered_map<std::pair<uint64_t, uint64_t>, float,
57 constexpr static float DistributionFactorVariance = 0.02f;
66 bool shouldVerifyFunction(
const Function *
F);
67 void verifyProbeFactors(
const Function *
F,
81 Function *getFunction()
const {
return F; }
82 uint64_t getFunctionHash()
const {
return FunctionHash; }
100 std::string CurModuleUniqueId;
Implements a lazy call graph analysis and related passes for the new pass manager.
Legalize the Machine IR a function s Machine IR
Machine Check Debug Module
FunctionAnalysisManager FAM
PassInstrumentationCallbacks PIC
This file defines the Pass Instrumentation classes that provide instrumentation points into the pass ...
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
LLVM Basic Block Representation.
Implements a dense probed hash-table based set.
An SCC of the call graph.
Represents a single loop in the control flow graph.
A Module instance is used to store all the information related to an LLVM module.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
A set of analyses that are preserved following a run of a transformation pass.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
PseudoProbeUpdatePass()=default
void registerCallbacks(PassInstrumentationCallbacks &PIC)
void runAfterPass(StringRef PassID, Any IR)
SampleProfileProbePass(TargetMachine *TM)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Sample profile pseudo prober.
void instrumentOneFunc(Function &F, TargetMachine *TM)
StringRef - Represent a constant reference to a string, i.e.
Primary interface to the complete machine description for the target machine.
@ C
The default llvm calling convention, compatible with C.
@ BasicBlock
Various leaf nodes.
This is an optimization pass for GlobalISel generic memory operations.
std::unordered_map< BasicBlock *, uint32_t > BlockIdMap
std::unordered_map< Instruction *, uint32_t > InstructionIdMap
std::unordered_map< std::pair< uint64_t, uint64_t >, float, pair_hash< uint64_t, uint64_t > > ProbeFactorMap
A CRTP mix-in to automatically provide informational APIs needed for passes.