42 #define DEBUG_TYPE "ip-regalloc"
44 #define RUIP_NAME "Register Usage Information Propagation"
67 MO.setRegMask(RegMask);
81 return new RegUsageInfoPropagationPass();
84 void RegUsageInfoPropagationPass::getAnalysisUsage(
AnalysisUsage &AU)
const {
90 bool RegUsageInfoPropagationPass::runOnMachineFunction(
MachineFunction &MF) {
94 DEBUG(
dbgs() <<
" ++++++++++++++++++++ " << getPassName()
95 <<
" ++++++++++++++++++++ \n");
105 <<
"Call Instruction Before Register Usage Info Propagation : \n");
108 auto UpdateRegMask = [&](
const Function *
F) {
112 setRegMask(
MI, &(*RegMask)[0]);
118 UpdateRegMask(cast<Function>(Operand.
getGlobal()));
123 <<
"Call Instruction After Register Usage Info Propagation : \n");
128 DEBUG(
dbgs() <<
" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
const GlobalValue * getGlobal() const
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A Module instance is used to store all the information related to an LLVM module. ...
A global registry used in conjunction with static constructors to make pluggable components (like tar...
const char * getSymbolName() const
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
iterator_range< mop_iterator > operands()
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
INITIALIZE_PASS_BEGIN(RegUsageInfoPropagationPass,"reg-usage-propagation", RUIP_NAME, false, false) INITIALIZE_PASS_END(RegUsageInfoPropagationPass
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
Function * getFunction(StringRef Name) const
Look up the specified function in the module symbol table.
FunctionPass * createRegUsageInfoPropPass()
Return a MachineFunction pass that identifies call sites and propagates register usage information of...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Represent the analysis usage information of a pass.
bool isSymbol() const
isSymbol - Tests if this is a MO_ExternalSymbol operand.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE,"Assign register bank of generic virtual registers", false, false) RegBankSelect
FunctionPass class - This class is used to implement most global optimizations.
MachineOperand class - Representation of each machine instruction operand.
Module.h This file contains the declarations for the Module class.
void initializeRegUsageInfoPropagationPassPass(PassRegistry &)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void setPreservesAll()
Set by analyses that do not transform their input at all.
Representation of each machine instruction.
const std::vector< uint32_t > * getRegUsageInfo(const Function *FP)
To query stored RegMask for given Function *, it will return nullptr if function is not known...
This pass is required to take advantage of the interprocedural register allocation infrastructure...
Module * getParent()
Get the module that this global value is contained inside of...
StringRef - Represent a constant reference to a string, i.e.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
StringRef getName() const
getName - Return the name of the corresponding LLVM function.