38 #define DEBUG_TYPE "ip-regalloc" 40 #define RUIP_NAME "Register Usage Information Propagation" 67 ->getRegInfo().getTargetRegisterInfo()
69 &&
"expected register mask size");
72 MO.setRegMask(RegMask.
data());
85 char RegUsageInfoPropagation::
ID = 0;
92 return dyn_cast<const Function>(MO.getGlobal());
95 return M.getFunction(MO.getSymbolName());
101 bool RegUsageInfoPropagation::runOnMachineFunction(
MachineFunction &MF) {
106 <<
" ++++++++++++++++++++ \n");
110 if (!MFI.hasCalls() && !MFI.hasTailCall())
113 bool Changed =
false;
121 <<
"Call Instruction Before Register Usage Info Propagation : \n" 124 auto UpdateRegMask = [&](
const Function &
F) {
128 setRegMask(
MI, RegMask);
133 if (
F->isDefinitionExact()) {
144 <<
"Call Instruction After Register Usage Info Propagation : \n" 150 dbgs() <<
" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" 156 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...
Function & getFunction()
Return the LLVM function that this machine code represents.
AnalysisUsage & addRequired()
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...
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.
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 &)
Representation of each machine instruction.
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.
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)