33 cl::desc(
"print register usage details collected for analysis."));
36 "Register Usage Information Storage",
false,
true)
45 RegMasks.grow(M.size());
53 RegMasks.shrink_and_clear();
59 RegMasks[&
FP] = RegMask;
64 auto It = RegMasks.find(&
FP);
65 if (It != RegMasks.end())
71 using FuncPtrRegMaskPair = std::pair<const Function *, std::vector<uint32_t>>;
76 for (
const auto &RegMask : RegMasks)
82 [](
const FuncPtrRegMaskPair *
A,
const FuncPtrRegMaskPair *
B) ->
bool {
83 return A->first->getName() <
B->first->getName();
86 for (
const FuncPtrRegMaskPair *FPRMPair : FPRMPairVector) {
87 OS << FPRMPair->first->getName() <<
" "
88 <<
"Clobbered Registers: ";
93 for (
unsigned PReg = 1, PRegE =
TRI->getNumRegs(); PReg < PRegE; ++PReg) {
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
unsigned const TargetRegisterInfo * TRI
Module.h This file contains the declarations for the Module class.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
static cl::opt< bool > DumpRegUsage("print-regusage", cl::init(false), cl::Hidden, cl::desc("print register usage details collected for analysis."))
This pass is required to take advantage of the interprocedural register allocation infrastructure.
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class describes a target machine that is implemented with the LLVM target-independent code gener...
static bool clobbersPhysReg(const uint32_t *RegMask, MCRegister PhysReg)
clobbersPhysReg - Returns true if this RegMask clobbers PhysReg.
A Module instance is used to store all the information related to an LLVM module.
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 ...
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...
bool doFinalization(Module &M) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
void storeUpdateRegUsageInfo(const Function &FP, ArrayRef< uint32_t > RegMask)
To store RegMask for given Function *.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
const STC & getSubtarget(const Function &F) const
This method returns a pointer to the specified type of TargetSubtargetInfo.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
TargetSubtargetInfo - Generic base class for all target subtargets.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
This class implements an extremely fast bulk output stream that can only output to a stream.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
void sort(IteratorTy Start, IteratorTy End)
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.