23 #define DEBUG_TYPE "ip-regalloc"
27 cl::desc(
"print register usage details collected for analysis."));
30 "Register Usage Informartion Stroage",
false,
true)
37 RegMasks.grow(M.
size());
45 RegMasks.shrink_and_clear();
50 const Function *FP, std::vector<uint32_t> RegMask) {
51 assert(FP !=
nullptr &&
"Function * can't be nullptr.");
52 RegMasks[FP] = std::move(RegMask);
55 const std::vector<uint32_t> *
57 auto It = RegMasks.find(FP);
58 if (It != RegMasks.end())
66 typedef std::pair<const Function *, std::vector<uint32_t>> FuncPtrRegMaskPair;
71 for (
const auto &RegMask : RegMasks)
76 FPRMPairVector.
begin(), FPRMPairVector.
end(),
77 [](
const FuncPtrRegMaskPair *
A,
const FuncPtrRegMaskPair *
B) ->
bool {
78 return A->first->getName() <
B->first->getName();
81 for (
const FuncPtrRegMaskPair *FPRMPair : FPRMPairVector) {
82 OS << FPRMPair->first->getName() <<
" "
83 <<
"Clobbered Registers: ";
87 for (
unsigned PReg = 1, PRegE = TRI->
getNumRegs(); PReg < PRegE; ++PReg) {
89 OS << TRI->
getName(PReg) <<
" ";
void push_back(const T &Elt)
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
A Module instance is used to store all the information related to an LLVM module. ...
void storeUpdateRegUsageInfo(const Function *FP, std::vector< uint32_t > RegMask)
To store RegMask for given Function *.
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
bool doInitialization(Module &M) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
bool doFinalization(Module &M) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
unsigned getNumRegs() const
Return the number of registers this target has (useful for sizing arrays holding per register informa...
static cl::opt< bool > DumpRegUsage("print-regusage", cl::init(false), cl::Hidden, cl::desc("print register usage details collected for analysis."))
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
initializer< Ty > init(const Ty &Val)
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Module.h This file contains the declarations for the Module class.
const STC & getSubtarget(const Function &F) const
This method returns a pointer to the specified type of TargetSubtargetInfo.
static bool clobbersPhysReg(const uint32_t *RegMask, unsigned PhysReg)
clobbersPhysReg - Returns true if this RegMask clobbers PhysReg.
TargetSubtargetInfo - Generic base class for all target subtargets.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
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...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class implements an extremely fast bulk output stream that can only output to a stream...
const char * getName(unsigned RegNo) const
Return the human-readable symbolic target-specific name for the specified physical register...
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")