Go to the documentation of this file.
29 #define DEBUG_TYPE "stackmaps"
33 cl::desc(
"Enable PatchPoint Liveness Analysis Pass"));
35 STATISTIC(NumStackMapFuncVisited,
"Number of functions visited");
36 STATISTIC(NumStackMapFuncSkipped,
"Number of functions skipped");
37 STATISTIC(NumBBsVisited,
"Number of basic blocks visited");
38 STATISTIC(NumBBsHaveNoStackmap,
"Number of basic blocks with no stackmap");
39 STATISTIC(NumStackMaps,
"Number of StackMaps visited");
88 "StackMap Liveness Analysis",
false,
false)
97 void StackMapLiveness::getAnalysisUsage(
AnalysisUsage &AU)
const {
110 << MF.
getName() <<
" **********\n");
112 ++NumStackMapFuncVisited;
116 ++NumStackMapFuncSkipped;
119 return calculateLiveness(MF);
124 bool HasChanged =
false;
126 for (
auto &
MBB : MF) {
130 LiveRegs.addLiveOutsNoPristines(
MBB);
131 bool HasStackMap =
false;
136 addLiveOutSetToMI(MF,
MI);
142 LiveRegs.stepBackward(
MI);
146 ++NumBBsHaveNoStackmap;
156 MI.addOperand(MF, MO);
164 for (
auto Reg : LiveRegs)
This is an optimization pass for GlobalISel generic memory operations.
uint32_t * allocateRegMask()
Allocate and initialize a register mask with NumRegister bits.
Reg
All possible values of the reg field in the ModR/M byte.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
A set of physical registers with utility functions to track liveness when walking backward/forward th...
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Properties which a MachineFunction may have at a given point in time.
unsigned const TargetRegisterInfo * TRI
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Represent the analysis usage information of a pass.
INITIALIZE_PASS(StackMapLiveness, "stackmap-liveness", "StackMap Liveness Analysis", false, false) StackMapLiveness
Default construct and initialize the pass.
MachineOperand class - Representation of each machine instruction operand.
MachineFunctionProperties & set(Property P)
STATISTIC(NumFunctions, "Total number of functions")
char & StackMapLivenessID
StackMapLiveness - This pass analyses the register live-out set of stackmap/patchpoint intrinsics and...
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Representation of each machine instruction.
initializer< Ty > init(const Ty &Val)
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
bool hasPatchPoint() const
This method may be called any time after instruction selection is complete to determine if there is a...
void setPreservesCFG()
This function should be called by the pass, iff they do not:
void setPreservesAll()
Set by analyses that do not transform their input at all.
static cl::opt< bool > EnablePatchPointLiveness("enable-patchpoint-liveness", cl::Hidden, cl::init(true), cl::desc("Enable PatchPoint Liveness Analysis Pass"))
void initializeStackMapLivenessPass(PassRegistry &)
auto reverse(ContainerTy &&C)
virtual void adjustStackMapLiveOutMask(uint32_t *Mask) const
Prior to adding the live-out mask to a stackmap or patchpoint instruction, provide the target the opp...
StringRef getName() const
Return the name of the corresponding LLVM basic block, or an empty string.
static MachineOperand CreateRegLiveOut(const uint32_t *Mask)