Go to the documentation of this file.
14 #ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
15 #define LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
26 class SelectionDAGBuilder;
51 auto I = Locations.find(Val);
52 if (
I == Locations.end())
58 assert(!Locations.count(Val) &&
59 "Trying to allocate already allocated location");
60 Locations[Val] = Location;
69 PendingGCRelocateCalls.push_back(&RelocCall);
79 auto I =
llvm::find(PendingGCRelocateCalls, &RelocCall);
80 assert(
I != PendingGCRelocateCalls.end() &&
81 "Visited unexpected gcrelocate call");
82 PendingGCRelocateCalls.erase(
I);
93 assert(Offset >= 0 && Offset < (
int)AllocatedStackSlots.
size() &&
95 assert(!AllocatedStackSlots.
test(Offset) &&
"already reserved!");
96 assert(NextSlotToAllocate <= (
unsigned)Offset &&
"consistency!");
97 AllocatedStackSlots.
set(Offset);
101 assert(Offset >= 0 && Offset < (
int)AllocatedStackSlots.
size() &&
103 return AllocatedStackSlots.
test(Offset);
118 unsigned NextSlotToAllocate = 0;
126 #endif // LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
This is an optimization pass for GlobalISel generic memory operations.
void startNewStatepoint(SelectionDAGBuilder &Builder)
Reset all state tracking for a newly encountered safepoint.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
bool test(unsigned Idx) const
SDValue allocateStackSlot(EVT ValueType, SelectionDAGBuilder &Builder)
Get a stack slot we can use to store an value of type ValueType.
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...
void reserveStackSlot(int Offset)
StatepointLoweringState()=default
void relocCallVisited(const GCRelocateInst &RelocCall)
Remove this gc_relocate from the list we're expecting to see before the next statepoint.
void clear()
Clear the memory usage of this object.
Represents calls to the gc.relocate intrinsic.
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
SDValue getLocation(SDValue Val)
Returns the spill location of a value incoming to the current statepoint.
SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameter...
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
bool isStackSlotAllocated(int Offset)
size_type size() const
Returns the number of bits in this bitvector.
This class tracks both per-statepoint and per-selectiondag information.
void setLocation(SDValue Val, SDValue Location)
void scheduleRelocCall(const GCRelocateInst &RelocCall)
Record the fact that we expect to encounter a given gc_relocate before the next statepoint.