15 #ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H 16 #define LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H 29 class SelectionDAGBuilder;
54 auto I = Locations.find(Val);
55 if (
I == Locations.end())
61 assert(!Locations.count(Val) &&
62 "Trying to allocate already allocated location");
63 Locations[Val] = Location;
70 PendingGCRelocateCalls.push_back(&RelocCall);
77 auto I =
llvm::find(PendingGCRelocateCalls, &RelocCall);
78 assert(
I != PendingGCRelocateCalls.end() &&
79 "Visited unexpected gcrelocate call");
80 PendingGCRelocateCalls.erase(
I);
91 assert(Offset >= 0 && Offset < (
int)AllocatedStackSlots.
size() &&
93 assert(!AllocatedStackSlots.
test(Offset) &&
"already reserved!");
94 assert(NextSlotToAllocate <= (
unsigned)Offset &&
"consistency!");
95 AllocatedStackSlots.
set(Offset);
99 assert(Offset >= 0 && Offset < (
int)AllocatedStackSlots.
size() &&
101 return AllocatedStackSlots.
test(Offset);
116 unsigned NextSlotToAllocate = 0;
124 #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 ...
This class represents lattice values for constants.
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.
bool test(unsigned Idx) const
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.
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
void setLocation(SDValue Val, SDValue Location)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
StatepointLoweringState()=default
size_t size() const
Returns the number of bits in this bitvector.
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...
A discriminated union of two pointer types, with the discriminator in the low bit of the pointer...