35 cl::desc(
"print register usage details collected for analysis."));
38 "Register Usage Information Storage",
false,
true)
47 RegMasks.grow(M.size());
55 RegMasks.shrink_and_clear();
61 RegMasks[&
FP] = RegMask;
66 auto It = RegMasks.find(&
FP);
67 if (It != RegMasks.end())
73 using FuncPtrRegMaskPair = std::pair<const Function *, std::vector<uint32_t>>;
78 for (
const auto &RegMask : RegMasks)
84 [](
const FuncPtrRegMaskPair *
A,
const FuncPtrRegMaskPair *
B) ->
bool {
85 return A->first->getName() <
B->first->getName();
88 for (
const FuncPtrRegMaskPair *FPRMPair : FPRMPairVector) {
89 OS << FPRMPair->first->getName() <<
" "
90 <<
"Clobbered Registers: ";
95 for (
unsigned PReg = 1, PRegE =
TRI->getNumRegs(); PReg < PRegE; ++PReg) {
107 return !PAC.preservedWhenStateless();
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Module.h This file contains the declarations for the Module class.
This header defines various interfaces for pass management in LLVM.
unsigned const TargetRegisterInfo * TRI
#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.
API to communicate dependencies between analyses during invalidation.
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
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.
PhysicalRegisterUsageInfo run(Module &M, ModuleAnalysisManager &)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
bool invalidate(Module &M, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &Inv)
bool doFinalization(Module &M)
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 doInitialization(Module &M)
void print(raw_ostream &OS, const Module *M=nullptr) const
void storeUpdateRegUsageInfo(const Function &FP, ArrayRef< uint32_t > RegMask)
To store RegMask for given Function *.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalysisChecker getChecker() const
Build a checker for this PreservedAnalyses and the specified analysis type.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Primary interface to the complete machine description for the target machine.
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.
Pass manager infrastructure for declaring and invalidating analyses.
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.
A special type used by analysis passes to provide an address that identifies that particular analysis...