15#ifndef LLVM_TRANSFORMS_IPO_SAMPLEPROFILEPROBE_H
16#define LLVM_TRANSFORMS_IPO_SAMPLEPROFILEPROBE_H
23#include <unordered_map>
36using BlockIdMap = std::unordered_map<BasicBlock *, uint32_t>;
40using ProbeFactorMap = std::unordered_map<std::pair<uint64_t, uint64_t>, float,
58 constexpr static float DistributionFactorVariance = 0.02f;
67 bool shouldVerifyFunction(
const Function *
F);
68 void verifyProbeFactors(
const Function *
F,
82 Function *getFunction()
const {
return F; }
83 uint64_t getFunctionHash()
const {
return FunctionHash; }
101 std::string CurModuleUniqueId;
This header defines various interfaces for pass management in LLVM.
Implements a lazy call graph analysis and related passes for the new pass manager.
Legalize the Machine IR a function s Machine IR
FunctionAnalysisManager FAM
PassInstrumentationCallbacks PIC
This file defines the Pass Instrumentation classes that provide instrumentation points into the pass ...
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.
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
PseudoProbeUpdatePass()=default
LLVM_ABI void registerCallbacks(PassInstrumentationCallbacks &PIC)
LLVM_ABI void runAfterPass(StringRef PassID, Any IR)
SampleProfileProbePass(TargetMachine *TM)
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
LLVM_ABI SampleProfileProber(Function &F)
LLVM_ABI void instrumentOneFunc(Function &F, TargetMachine *TM)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
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.
This is an optimization pass for GlobalISel generic memory operations.
std::unordered_map< Instruction *, uint32_t > InstructionIdMap
StringMap< ProbeFactorMap > FuncProbeFactorMap
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
std::unordered_map< BasicBlock *, uint32_t > BlockIdMap
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
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.