21#define DEBUG_TYPE "livestacks"
25 "Live Stack Slot Analysis",
false,
false)
41 VNInfoAllocator.Reset();
47 for (
auto &[Slot, LI] : S2IMap) {
49 return SI.isStaleIndex(S.
start) ||
SI.isStaleIndex(S.
end);
57 if (
SI.isStaleIndex(
End))
58 End =
SI.canonicalizeIndex(
End).getDeadSlot();
76 assert(Slot >= 0 &&
"Spill slot indice must be >= 0");
77 SS2IntervalMap::iterator
I = S2IMap.find(Slot);
78 if (
I == S2IMap.end()) {
81 std::piecewise_construct, std::forward_as_tuple(Slot),
84 S2RCMap.insert(std::make_pair(Slot, RC));
88 OldRC = TRI->getCommonSubClass(OldRC, RC);
123 OS <<
"********** INTERVALS **********\n";
129 OS <<
" [" << TRI->getRegClassName(RC) <<
"]\n";
131 OS <<
" [Unknown]\n";
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent the analysis usage information of a pass.
Module * getParent()
Get the module that this global value is contained inside of...
LiveInterval - This class represents the liveness of a register, or stack slot.
LLVM_ABI LiveStacks run(MachineFunction &MF, MachineFunctionAnalysisManager &)
LLVM_ABI PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &AM)
void print(raw_ostream &O, const Module *=nullptr) const override
print - Implement the dump method.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool runOnMachineFunction(MachineFunction &) override
runOnMachineFunction - pass entry point
LiveStacksWrapperLegacy()
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
SS2IntervalMap::const_iterator const_iterator
LLVM_ABI LiveInterval & getOrCreateInterval(int Slot, const TargetRegisterClass *RC)
LLVM_ABI void print(raw_ostream &O, const Module *M=nullptr) const
print - Implement the dump method.
const TargetRegisterClass * getIntervalRegClass(int Slot) const
const_iterator end() const
LLVM_ABI void canonicalizeIndexes(const SlotIndexes &SI)
Move segment boundaries off erased instructions, ahead of compaction.
const_iterator begin() const
LLVM_ABI void init(MachineFunction &MF)
init - analysis entry point
LLVM_ABI void releaseMemory()
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Function & getFunction()
Return the LLVM function that this machine code represents.
A Module instance is used to store all the information related to an LLVM module.
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.
static Register index2StackSlot(int FI)
Convert a frame index to a stack slot register value.
SlotIndex - An opaque wrapper around machine indexes.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
virtual const TargetRegisterInfo * getRegisterInfo() const =0
Return the target's register information.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
Printable print(const GCNRegPressure &RP, const GCNSubtarget *ST=nullptr, unsigned DynamicVGPRBlockSize=0)
LLVM_ABI char & LiveStacksID
LiveStacks pass. An analysis keeping track of the liveness of stack slots.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
bool none_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::none_of which take ranges instead of having to pass begin/end explicitly.
@ End
Run the machine verifier once, at the end of the pipeline.
MCRegisterClass TargetRegisterClass
A special type used by analysis passes to provide an address that identifies that particular analysis...
This represents a simple continuous liveness interval for a value.