14#ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
15#define LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
26class 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);
96 assert(NextSlotToAllocate <= (
unsigned)
Offset &&
"consistency!");
118 unsigned NextSlotToAllocate = 0;
This file defines the DenseMap class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file implements the SmallBitVector class.
This file defines the SmallVector class.
Represents calls to the gc.relocate intrinsic.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameter...
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is ...
bool test(unsigned Idx) const
size_type size() const
Returns the number of bits in this bitvector.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This class tracks both per-statepoint and per-selectiondag information.
void clear()
Clear the memory usage of this object.
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 scheduleRelocCall(const GCRelocateInst &RelocCall)
Record the fact that we expect to encounter a given gc_relocate before the next statepoint.
bool isStackSlotAllocated(int Offset)
void setLocation(SDValue Val, SDValue Location)
StatepointLoweringState()=default
void relocCallVisited(const GCRelocateInst &RelocCall)
Remove this gc_relocate from the list we're expecting to see before the next statepoint.
void startNewStatepoint(SelectionDAGBuilder &Builder)
Reset all state tracking for a newly encountered safepoint.
void reserveStackSlot(int Offset)
This is an optimization pass for GlobalISel generic memory operations.
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.