39 #define DEBUG_TYPE "ip-regalloc" 41 #define RUIP_NAME "Register Usage Information Propagation" 70 &&
"expected register mask size");
73 MO.setRegMask(RegMask.
data());
86 char RegUsageInfoPropagation::
ID = 0;
93 return dyn_cast<const Function>(MO.getGlobal());
96 return M.getFunction(MO.getSymbolName());
102 bool RegUsageInfoPropagation::runOnMachineFunction(
MachineFunction &MF) {
107 <<
" ++++++++++++++++++++ \n");
111 if (!MFI.hasCalls() && !MFI.hasTailCall())
114 bool Changed =
false;
122 <<
"Call Instruction Before Register Usage Info Propagation : \n");
125 auto UpdateRegMask = [&](
const Function &
F) {
129 setRegMask(
MI, RegMask);
140 dbgs() <<
"Call Instruction After Register Usage Info Propagation : " 146 dbgs() <<
" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" 152 return new RegUsageInfoPropagation();
INITIALIZE_PASS_BEGIN(RegUsageInfoPropagation, "reg-usage-propagation", RUIP_NAME, false, false) INITIALIZE_PASS_END(RegUsageInfoPropagation
static unsigned getRegMaskSize(unsigned NumRegs)
Returns number of elements needed for a regmask array.
ArrayRef< uint32_t > getRegUsageInfo(const Function &FP)
To query stored RegMask for given Function *, it will returns ane empty array if function is not know...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This class represents lattice values for constants.
static const Function * findCalledFunction(const Module &M, const MachineInstr &MI)
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...
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...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
FunctionPass * createRegUsageInfoPropPass()
Return a MachineFunction pass that identifies call sites and propagates register usage information of...
unsigned getNumRegs() const
Return the number of registers this target has (useful for sizing arrays holding per register informa...
const TargetRegisterInfo * getTargetRegisterInfo() const
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
size_t size() const
size - Get the array size.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
MachineOperand class - Representation of each machine instruction operand.
Module.h This file contains the declarations for the Module class.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
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.
void initializeRegUsageInfoPropagationPass(PassRegistry &)
const MachineBasicBlock * getParent() const
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
This pass is required to take advantage of the interprocedural register allocation infrastructure...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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...
bool empty() const
empty - Check if the array is empty.