25#define DEBUG_TYPE "pseudo-probe-inserter"
62 auto Value =
DL->getDiscriminator();
98 if (Cur->getOpcode() != TargetOpcode::PSEUDO_PROBE)
101 auto *ProbeInstr = &*Cur;
115 if (
MI.isPseudoProbe())
119 for (
auto *
MI : ToBeRemoved)
120 MI->eraseFromParent();
122 Changed |= !ToBeRemoved.
empty();
131 auto Name =
DL->getSubprogramLinkageName();
135 bool ShouldRun =
false;
139char PseudoProbeInserter::ID = 0;
141 "Insert pseudo probe annotations for value profiling",
149 return new PseudoProbeInserter();
for(const MachineOperand &MO :llvm::drop_begin(OldMI.operands(), Desc.getNumOperands()))
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Given that RA is a live value
const HexagonInstrInfo * TII
Module.h This file contains the declarations for the Module class.
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
Insert pseudo probe annotations for value profiling
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
static bool isPseudoProbeDiscriminator(unsigned Discriminator)
FunctionPass class - This class is used to implement most global optimizations.
GUID getGUID() const
Return a 64-bit global unique ID constructed from global value name (i.e.
Module * getParent()
Get the module that this global value is contained inside of...
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
MachineInstr * remove(MachineInstr *I)
Remove the unbundled instruction from the instruction list without deleting it.
reverse_iterator rbegin()
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
bool doInitialization(Module &) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Function & getFunction()
Return the LLVM function that this machine code represents.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
Representation of each machine instruction.
A Module instance is used to store all the information related to an LLVM module.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
TargetInstrInfo - Interface to description of machine instruction set.
Target-Independent Code Generator Pass Configuration Options.
virtual const TargetInstrInfo * getInstrInfo() const
LLVM Value Representation.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
FunctionPass * createPseudoProbeInserter()
This pass inserts pseudo probe annotation for callsite profiling.
void initializePseudoProbeInserterPass(PassRegistry &)
constexpr const char * PseudoProbeDescMetadataName
static uint32_t extractProbeIndex(uint32_t Value)
static uint32_t extractProbeAttributes(uint32_t Value)
static uint32_t extractProbeType(uint32_t Value)