15 #ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
16 #define LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
24 class SelectionDAGBuilder;
49 auto I = Locations.find(Val);
50 if (
I == Locations.end())
56 assert(!Locations.count(Val) &&
57 "Trying to allocate already allocated location");
58 Locations[Val] = Location;
65 PendingGCRelocateCalls.push_back(&RelocCall);
72 auto I =
find(PendingGCRelocateCalls, &RelocCall);
73 assert(
I != PendingGCRelocateCalls.end() &&
74 "Visited unexpected gcrelocate call");
75 PendingGCRelocateCalls.erase(
I);
86 assert(Offset >= 0 && Offset < (
int)AllocatedStackSlots.
size() &&
88 assert(!AllocatedStackSlots.
test(Offset) &&
"already reserved!");
89 assert(NextSlotToAllocate <= (
unsigned)Offset &&
"consistency!");
90 AllocatedStackSlots.
set(Offset);
94 assert(Offset >= 0 && Offset < (
int)AllocatedStackSlots.
size() &&
96 return AllocatedStackSlots.
test(Offset);
111 unsigned NextSlotToAllocate;
118 #endif // LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...
SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameter...
This class represents a function call, abstracting a target machine's calling convention.
StatepointLoweringState()
void reserveStackSlot(int Offset)
bool isStackSlotAllocated(int Offset)
SDValue getLocation(SDValue Val)
Returns the spill location of a value incoming to the current statepoint.
SDValue allocateStackSlot(EVT ValueType, SelectionDAGBuilder &Builder)
Get a stack slot we can use to store an value of type ValueType.
void clear()
Clear the memory usage of this object.
This class tracks both per-statepoint and per-selectiondag information.
EVT - Extended Value Type.
void setLocation(SDValue Val, SDValue Location)
auto find(R &&Range, const T &Val) -> decltype(std::begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
size_t size() const
Returns the number of bits in this bitvector.
bool test(unsigned Idx) const
void startNewStatepoint(SelectionDAGBuilder &Builder)
Reset all state tracking for a newly encountered safepoint.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void scheduleRelocCall(const CallInst &RelocCall)
Record the fact that we expect to encounter a given gc_relocate before the next statepoint.
void relocCallVisited(const CallInst &RelocCall)
Remove this gc_relocate from the list we're expecting to see before the next statepoint.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...