Go to the documentation of this file.
55 #define DEBUG_TYPE "statepoint-lowering"
57 STATISTIC(NumSlotsAllocatedForStatepoints,
58 "Number of stack slots allocated for statepoints");
59 STATISTIC(NumOfStatepoints,
"Number of statepoint nodes encountered");
61 "Maximum number of stack slots required for a singe statepoint");
65 cl::desc(
"Allow using registers for non pointer deopt args"));
69 cl::desc(
"Allow using registers for gc pointer in landing pad"));
73 cl::desc(
"Max number of VRegs allowed to pass GC pointer meta args in"));
77 cl::desc(
"Force spilling of base GC pointers"));
84 Ops.push_back(
Builder.DAG.getTargetConstant(StackMaps::ConstantOp, L,
91 assert(PendingGCRelocateCalls.empty() &&
92 "Trying to visit statepoint before finished processing previous one");
94 NextSlotToAllocate = 0;
98 AllocatedStackSlots.
clear();
99 AllocatedStackSlots.
resize(
Builder.FuncInfo.StatepointStackSlots.size());
104 AllocatedStackSlots.
clear();
105 assert(PendingGCRelocateCalls.empty() &&
106 "cleared before statepoint sequence completed");
112 NumSlotsAllocatedForStatepoints++;
115 unsigned SpillSize =
ValueType.getStoreSize();
117 (-8u & (7 +
ValueType.getSizeInBits())) &&
118 "Size not in bytes?");
124 const size_t NumSlots = AllocatedStackSlots.
size();
125 assert(NextSlotToAllocate <= NumSlots &&
"Broken invariant");
128 Builder.FuncInfo.StatepointStackSlots.size() &&
131 for (; NextSlotToAllocate < NumSlots; NextSlotToAllocate++) {
132 if (!AllocatedStackSlots.
test(NextSlotToAllocate)) {
133 const int FI =
Builder.FuncInfo.StatepointStackSlots[NextSlotToAllocate];
135 AllocatedStackSlots.
set(NextSlotToAllocate);
145 const unsigned FI = cast<FrameIndexSDNode>(SpillSlot)->getIndex();
148 Builder.FuncInfo.StatepointStackSlots.push_back(FI);
149 AllocatedStackSlots.
resize(AllocatedStackSlots.
size()+1,
true);
151 Builder.FuncInfo.StatepointStackSlots.size() &&
154 StatepointMaxSlotsRequired.updateMax(
155 Builder.FuncInfo.StatepointStackSlots.size());
167 if (LookUpDepth <= 0)
171 if (
const auto *Relocate = dyn_cast<GCRelocateInst>(Val)) {
172 const auto &RelocationMap =
173 Builder.FuncInfo.StatepointRelocationMaps[Relocate->getStatepoint()];
175 auto It = RelocationMap.find(Relocate->getDerivedPtr());
176 if (It == RelocationMap.end())
179 auto &
Record = It->second;
187 if (
const BitCastInst *Cast = dyn_cast<BitCastInst>(Val))
193 if (
const PHINode *Phi = dyn_cast<PHINode>(Val)) {
196 for (
auto &IncomingValue : Phi->incoming_values()) {
202 if (MergedResult.
hasValue() && *MergedResult != *SpillSlot)
205 MergedResult = SpillSlot;
247 if (isa<FrameIndexSDNode>(Incoming))
257 return (isa<ConstantSDNode>(Incoming) || isa<ConstantFPSDNode>(Incoming) ||
275 SDValue OldLocation =
Builder.StatepointLowering.getLocation(Incoming);
280 const int LookUpDepth = 6;
283 if (!
Index.hasValue())
286 const auto &StatepointSlots =
Builder.FuncInfo.StatepointStackSlots;
288 auto SlotIt =
find(StatepointSlots, *
Index);
289 assert(SlotIt != StatepointSlots.end() &&
290 "Value spilled to the unknown stack slot");
293 const int Offset = std::distance(StatepointSlots.begin(), SlotIt);
294 if (
Builder.StatepointLowering.isStackSlotAllocated(
Offset)) {
310 Builder.StatepointLowering.setLocation(Incoming, Loc);
319 SDValue ReturnValue, CallEndVal;
320 std::tie(ReturnValue, CallEndVal) =
340 bool HasDef = !
SI.CLI.RetTy->isVoidTy();
370 static std::tuple<SDValue, SDValue, MachineMemOperand*>
380 int Index = cast<FrameIndexSDNode>(Loc)->getIndex();
393 "Bad spill: stack slot does not match!");
398 auto &MF =
Builder.DAG.getMachineFunction();
400 auto *StoreMMO = MF.getMachineMemOperand(
403 Chain =
Builder.DAG.getStore(Chain,
Builder.getCurSDLoc(), Incoming, Loc,
408 Builder.StatepointLowering.setLocation(Incoming, Loc);
412 return std::make_tuple(Loc, Chain, MMO);
430 "Incoming value is a frame index!");
431 Ops.push_back(
Builder.DAG.getTargetFrameIndex(FI->getIndex(),
434 auto &MF =
Builder.DAG.getMachineFunction();
436 MemRefs.push_back(MMO);
460 C->getValueAPF().bitcastToAPInt().getZExtValue());
469 if (!RequireSpillSlot) {
477 Ops.push_back(Incoming);
486 Ops.push_back(std::get<0>(Res));
487 if (
auto *MMO = std::get<2>(Res))
488 MemRefs.push_back(MMO);
489 Chain = std::get<1>(Res);;
499 if (!Ty->isPtrOrPtrVectorTy())
502 if (
auto IsManaged = GFI->getStrategy().isGCManagedPointer(Ty))
531 for (
const Value *V :
SI.Bases) {
533 if (Opt.hasValue()) {
535 "non gc managed base pointer found in statepoint");
538 for (
const Value *V :
SI.Ptrs) {
540 if (Opt.hasValue()) {
542 "non gc managed derived pointer found in statepoint");
545 assert(
SI.Bases.size() ==
SI.Ptrs.size() &&
"Pointer without base!");
547 assert(
SI.Bases.empty() &&
"No gc specified, so cannot relocate pointers!");
548 assert(
SI.Ptrs.empty() &&
"No gc specified, so cannot relocate pointers!");
562 const bool LiveInDeopt =
572 if (
auto *StInvoke = dyn_cast_or_null<InvokeInst>(
SI.StatepointInstr)) {
574 for (
auto *Relocate :
SI.GCRelocates)
575 if (Relocate->getOperand(0) == LPI) {
576 LPadPointers.
insert(
Builder.getValue(Relocate->getBasePtr()));
577 LPadPointers.
insert(
Builder.getValue(Relocate->getDerivedPtr()));
588 unsigned CurNumVRegs = 0;
590 auto canPassGCPtrOnVReg = [&](
SDValue SD) {
591 if (SD.getValueType().isVector())
593 if (LPadPointers.
count(SD))
598 auto processGCPtr = [&](
const Value *V) {
600 if (!LoweredGCPtrs.
insert(PtrSD))
602 GCPtrIndexMap[PtrSD] = LoweredGCPtrs.
size() - 1;
604 assert(!LowerAsVReg.
count(PtrSD) &&
"must not have been seen");
605 if (LowerAsVReg.
size() == MaxVRegPtrs)
608 "IR and SD types disagree");
609 if (!canPassGCPtrOnVReg(PtrSD)) {
614 LowerAsVReg[PtrSD] = CurNumVRegs++;
620 for (
const Value *V :
SI.Bases)
625 auto requireSpillSlot = [&](
const Value *V) {
626 if (!
Builder.DAG.getTargetLoweringInfo().isTypeLegal(
627 Builder.getValue(V).getValueType()))
639 for (
const Value *V :
SI.DeoptState) {
640 if (requireSpillSlot(V))
644 for (
const Value *V :
SI.Ptrs) {
646 if (!LowerAsVReg.
count(SDV))
650 for (
const Value *V :
SI.Bases) {
652 if (!LowerAsVReg.
count(SDV))
659 const int NumVMSArgs =
SI.DeoptState.size();
665 for (
const Value *V :
SI.DeoptState) {
670 int FI =
Builder.FuncInfo.getArgumentFrameIndex(
Arg);
672 Incoming =
Builder.DAG.getFrameIndex(FI,
Builder.getFrameIndexTy());
675 Incoming =
Builder.getValue(V);
677 <<
" requireSpillSlot = " << requireSpillSlot(V) <<
"\n");
684 for (
SDValue SDV : LoweredGCPtrs)
689 GCPtrs = LoweredGCPtrs.takeVector();
702 "Incoming value is a frame index!");
703 Allocas.push_back(
Builder.DAG.getTargetFrameIndex(
704 FI->getIndex(),
Builder.getFrameIndexTy()));
706 auto &MF =
Builder.DAG.getMachineFunction();
708 MemRefs.push_back(MMO);
712 Ops.
append(Allocas.begin(), Allocas.end());
717 for (
unsigned i = 0;
i <
SI.Ptrs.size(); ++
i) {
719 assert(GCPtrIndexMap.
count(Base) &&
"base not found in index map");
723 assert(GCPtrIndexMap.
count(Derived) &&
"derived not found in index map");
740 LLVM_DEBUG(
dbgs() <<
"Lowering statepoint " << *
SI.StatepointInstr <<
"\n");
742 for (
auto *Reloc :
SI.GCRelocates)
743 if (Reloc->getParent() ==
SI.StatepointInstr->getParent())
766 std::tie(ReturnVal, CallNode) =
777 if (CallHasIncomingGlue) {
789 const bool IsGCTransition =
792 if (IsGCTransition) {
796 TSOps.push_back(Chain);
799 for (
const Value *V :
SI.GCTransitionArgs) {
806 if (CallHasIncomingGlue)
807 TSOps.push_back(Glue);
814 Chain = GCTransitionStart.
getValue(0);
815 Glue = GCTransitionStart.
getValue(1);
830 unsigned NumCallRegArgs =
836 Ops.push_back(CallTarget);
841 if (CallHasIncomingGlue)
842 RegMaskIt = CallNode->
op_end() - 2;
844 RegMaskIt = CallNode->
op_end() - 1;
851 uint64_t Flags =
SI.StatepointFlags;
853 "Unknown flag used");
860 Ops.push_back(*RegMaskIt);
863 Ops.push_back(Chain);
872 for (
auto SD : LoweredGCArgs) {
873 if (!LowerAsVReg.
count(SD))
875 NodeTys.push_back(SD.getValueType());
877 LLVM_DEBUG(
dbgs() <<
"Statepoint has " << NodeTys.size() <<
" results\n");
878 assert(NodeTys.size() == LowerAsVReg.
size() &&
"Inconsistent GC Ptr lowering");
882 unsigned NumResults = NodeTys.size();
890 for (
const auto *Relocate :
SI.GCRelocates) {
891 Value *Derived = Relocate->getDerivedPtr();
893 if (!LowerAsVReg.
count(SD))
897 if (VirtRegs.
count(SD))
902 auto *RetTy = Relocate->getType();
908 PendingExports.push_back(Chain);
923 if (LowerAsVReg.
count(SDV)) {
926 Record.payload.Reg = VirtRegs[SDV];
929 Record.payload.FI = cast<FrameIndexSDNode>(Loc)->getIndex();
939 RelocationMap[V] =
Record;
944 SDNode *SinkNode = StatepointMCNode;
950 if (IsGCTransition) {
954 TEOps.push_back(
SDValue(StatepointMCNode, NumResults - 2));
957 for (
const Value *V :
SI.GCTransitionArgs) {
964 TEOps.push_back(
SDValue(StatepointMCNode, NumResults - 1));
971 SinkNode = GCTransitionStart.
getNode();
978 SDValue StatepointValues[2] = {
SDValue(SinkNode, NumSinkValues - 2),
979 SDValue(SinkNode, NumSinkValues - 1)};
1001 "anyregcc is not supported on statepoints!");
1006 "GCStrategy does not expect to encounter statepoints");
1012 if (
I.getNumPatchBytes() > 0) {
1025 I.getNumCallArgs(), ActualCallee,
1026 I.getActualReturnType(),
false );
1043 SI.GCRelocates.push_back(Relocate);
1046 if (Seen.
insert(DerivedSD).second) {
1047 SI.Bases.push_back(Relocate->getBasePtr());
1048 SI.Ptrs.push_back(Relocate->getDerivedPtr());
1058 for (
Value *V :
I.deopt_operands()) {
1062 SI.Bases.push_back(V);
1063 SI.Ptrs.push_back(V);
1068 SI.StatepointInstr = &
I;
1073 I.gc_transition_args_end());
1075 SI.StatepointFlags =
I.getFlags();
1076 SI.NumPatchBytes =
I.getNumPatchBytes();
1077 SI.EHPadBB = EHPadBB;
1082 const std::pair<bool, bool> GCResultLocality =
I.getGCResultLocality();
1083 Type *RetTy =
I.getActualReturnType();
1086 (!GCResultLocality.first && !GCResultLocality.second)) {
1092 if (GCResultLocality.first) {
1099 if (!GCResultLocality.second)
1112 I.getCallingConv());
1116 PendingExports.push_back(Chain);
1122 bool VarArgDisallowed,
bool ForceVoidReturnTy) {
1124 unsigned ArgBeginIndex =
Call->arg_begin() -
Call->op_begin();
1129 if (!VarArgDisallowed)
1130 SI.CLI.IsVarArg =
Call->getFunctionType()->isVarArg();
1137 SI.ID = SD.StatepointID.getValueOr(DefaultID);
1138 SI.NumPatchBytes = SD.NumPatchBytes.getValueOr(0);
1143 SI.EHPadBB = EHPadBB;
1160 void SelectionDAGBuilder::visitGCResult(
const GCResultInst &CI) {
1175 Type *RetTy =
SI->getActualReturnType();
1182 void SelectionDAGBuilder::visitGCRelocate(
const GCRelocateInst &Relocate) {
1193 assert(*IsManaged &&
"Non gc managed pointer relocated!");
1197 auto &RelocationMap =
1199 auto SlotIt = RelocationMap.find(DerivedPtr);
1200 assert(SlotIt != RelocationMap.end() &&
"Relocating not lowered gc value");
1214 Chain,
nullptr,
nullptr);
1236 MFI.getObjectSize(
Index),
1237 MFI.getObjectAlign(
Index));
void LowerStatepoint(const GCStatepointInst &I, const BasicBlock *EHPadBB=nullptr)
This class represents an incoming formal argument to a Function.
static void pushStackMapConstant(SmallVectorImpl< SDValue > &Ops, SelectionDAGBuilder &Builder, uint64_t Value)
Represents a use of a SDNode.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
GCStrategy describes a garbage collector algorithm's code generation requirements,...
void startNewStatepoint(SelectionDAGBuilder &Builder)
Reset all state tracking for a newly encountered safepoint.
void setValue(const Value *V, SDValue NewN)
bool isPointerTy() const
True if this is an instance of PointerType.
SmallVector< SDValue, 8 > PendingLoads
Loads are not emitted to the program immediately.
SDNode * getNode() const
get the SDNode which holds the desired result
size_type size() const
Determine the number of elements in the SetVector.
This class represents a no-op cast from one type to another.
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Helper object to track which of three possible relocation mechanisms are used for a particular value ...
The landingpad instruction holds all of the information necessary to generate correct exception handl...
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, Align base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
An SDNode that represents everything that will be needed to construct a MachineInstr.
SDValue getValue(const Value *V)
getValue - Return an SDValue for the given Value.
const SDValue & getRoot() const
Return the root tag of the SelectionDAG.
Represents one node in the SelectionDAG.
void ReplaceAllUsesWith(SDValue From, SDValue To)
Modify anything using 'From' to use 'To' instead.
The instances of the Type class are immutable: once they are created, they are never changed.
static Optional< int > findPreviousSpillSlot(const Value *Val, SelectionDAGBuilder &Builder, int LookUpDepth)
Utility function for reservePreviousStackSlotForValue.
void LowerCallSiteWithDeoptBundle(const CallBase *Call, SDValue Callee, const BasicBlock *EHPadBB)
A description of a memory reference used in the backend.
unsigned TrapUnreachable
Emit target-specific trap instruction for 'unreachable' IR instructions.
DenseMap< const Value *, Register > ValueMap
ValueMap - Since we emit code for the function a basic block at a time, we must remember which virtua...
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
GCStrategy & getStrategy()
getStrategy - Return the GC strategy for the function.
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
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.
LLVMContext * getContext() const
void getCopyToRegs(SDValue Val, SelectionDAG &DAG, const SDLoc &dl, SDValue &Chain, SDValue *Flag, const Value *V=nullptr, ISD::NodeType PreferredExtendType=ISD::ANY_EXTEND) const
Emit a series of CopyToReg nodes that copies the specified value into the registers specified by this...
LLVM Basic Block Representation.
constexpr bool hasValue() const
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
op_iterator op_end() const
Represents a gc.statepoint intrinsic call.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
@ GC_TRANSITION_START
GC_TRANSITION_START/GC_TRANSITION_END - These operators mark the beginning and end of GC transition s...
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands,...
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
cl::opt< bool > AlwaysSpillBase("statepoint-always-spill-base", cl::Hidden, cl::init(true), cl::desc("Force spilling of base GC pointers"))
SDValue getTargetFrameIndex(int FI, EVT VT)
EVT getValueType() const
Return the ValueType of the referenced return value.
SDValue lowerRangeToAssertZExt(SelectionDAG &DAG, const Instruction &I, SDValue Op)
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
const TargetLowering & getTargetLoweringInfo() const
(vector float) vec_cmpeq(*A, *B) C
SDValue getSrcValue(const Value *v)
Construct a node to track a Value* through the backend.
static const uint64_t DeoptBundleStatepointID
cl::opt< bool > UseRegistersForGCPointersInLandingPad("use-registers-for-gc-values-in-landing-pad", cl::Hidden, cl::init(false), cl::desc("Allow using registers for gc pointer in landing pad"))
static void reservePreviousStackSlotForValue(const Value *IncomingValue, SelectionDAGBuilder &Builder)
Try to find existing copies of the incoming values in stack slots used for statepoint spilling.
const SDValue & setRoot(SDValue N)
Set the current root tag of the SelectionDAG.
static MachineMemOperand * getMachineMemOperand(MachineFunction &MF, FrameIndexSDNode &FI)
cl::opt< unsigned > MaxRegistersForGCPointers("max-registers-for-gc-values", cl::Hidden, cl::init(0), cl::desc("Max number of VRegs allowed to pass GC pointer meta args in"))
STATISTIC(NumFunctions, "Total number of functions")
void LowerDeoptimizeCall(const CallInst *CI)
TypeSize getValueSizeInBits() const
Returns the size of the value in bits.
@ CopyFromReg
CopyFromReg - This node indicates that the input value is a virtual or physical register that is defi...
This struct represents the registers (physical or virtual) that a particular set of values is assigne...
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.
void clear()
Clear all bits.
size_type count(const T &V) const
count - Return 1 if the element is in the set, 0 otherwise.
Represents calls to the gc.relocate intrinsic.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
auto find(R &&Range, const T &Val)
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly.
@ LOAD
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
static bool willLowerDirectly(SDValue Incoming)
Return true if-and-only-if the given SDValue can be lowered as either a constant argument or a stack ...
Value * getDerivedPtr() const
@ TRAP
TRAP - Trapping instruction.
SDValue getCopyFromRegs(const Value *V, Type *Ty)
If there was virtual register allocated for the value V emit CopyFromReg of the specified type Ty.
const SDValue & getOperand(unsigned Num) const
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
Align getObjectAlign(int ObjectIdx) const
Return the alignment of the specified stack object.
initializer< Ty > init(const Ty &Val)
static std::tuple< SDValue, SDValue, MachineMemOperand * > spillIncomingStatepointValue(SDValue Incoming, SDValue Chain, SelectionDAGBuilder &Builder)
Spill a value incoming to the statepoint.
SDValue LowerAsSTATEPOINT(StatepointLoweringInfo &SI)
Lower SLI into a STATEPOINT instruction.
StatepointLoweringState StatepointLowering
State used while lowering a statepoint sequence (gc_statepoint, gc_relocate, and gc_result).
SDValue getValue(unsigned R) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MVT getFrameIndexTy()
Returns the type of FrameIndex and TargetFrameIndex nodes.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Register CreateRegs(const Value *V)
MachineSDNode * getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT)
These are used for target selectors to create a new node with specified return type(s),...
bool isVoidTy() const
Return true if this is 'void'.
void setNodeMemRefs(MachineSDNode *N, ArrayRef< MachineMemOperand * > NewMemRefs)
Mutate the specified machine node's memory references to the provided list.
void resize(unsigned N, bool t=false)
Grow or shrink the bitvector.
Describes a gc.statepoint or a gc.statepoint like thing for the purposes of lowering into a STATEPOIN...
bool insert(const value_type &X)
Insert a new element into the SetVector.
SDValue getLocation(SDValue Val)
Returns the spill location of a value incoming to the current statepoint.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
bool isVector() const
Return true if this is a vector value type.
SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameter...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Type * getType() const
All values are typed, get the type of this value.
Represents calls to the gc.result intrinsic.
void append_range(Container &C, Range &&R)
Wrapper function to append a range to a container.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
SDLoc getCurSDLoc() const
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
DenseMap< const Instruction *, StatepointSpillMapTy > StatepointRelocationMaps
@ GCTransition
Indicates that this statepoint is a transition from GC-aware code to code that is not GC-aware.
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
@ MOVolatile
The memory access is volatile.
static void lowerIncomingStatepointValue(SDValue Incoming, bool RequireSpillSlot, SmallVectorImpl< SDValue > &Ops, SmallVectorImpl< MachineMemOperand * > &MemRefs, SelectionDAGBuilder &Builder)
Lower a single value incoming to a statepoint node.
@ MOLoad
The memory access reads data.
Wrapper class representing virtual and physical registers.
amdgpu Simplify well known AMD library false FunctionCallee Callee
virtual Optional< bool > isGCManagedPointer(const Type *Ty) const
If the type specified can be reliably distinguished, returns true for pointers to GC managed location...
static bool isGCValue(const Value *V, SelectionDAGBuilder &Builder)
Return true if value V represents the GC value.
unsigned getNumOperands() const
Return the number of values used by this operation.
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
const DataLayout & getDataLayout() const
static std::pair< SDValue, SDNode * > lowerCallFromStatepointLoweringInfo(SelectionDAGBuilder::StatepointLoweringInfo &SI, SelectionDAGBuilder &Builder, SmallVectorImpl< SDValue > &PendingExports)
Extract call from statepoint, lower it and return pointer to the call node.
FunctionLoweringInfo & FuncInfo
Information about the function as a whole.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
void LowerCallSiteWithDeoptBundleImpl(const CallBase *Call, SDValue Callee, const BasicBlock *EHPadBB, bool VarArgDisallowed, bool ForceVoidReturnTy)
@ MOStore
The memory access writes data.
static Type * getVoidTy(LLVMContext &C)
op_iterator op_begin() const
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
void scheduleRelocCall(const GCRelocateInst &RelocCall)
Record the fact that we expect to encounter a given gc_relocate before the next statepoint.
bool useStatepoints() const
Returns true if this strategy is expecting the use of gc.statepoints, and false otherwise.
StatepointDirectives parseStatepointDirectivesFromAttrs(AttributeList AS)
Parse out statepoint directives from the function attributes present in AS.
static MachinePointerInfo getFixedStack(MachineFunction &MF, int FI, int64_t Offset=0)
Return a MachinePointerInfo record that refers to the specified FrameIndex.
cl::opt< bool > UseRegistersForDeoptValues("use-registers-for-deopt-values", cl::Hidden, cl::init(false), cl::desc("Allow using registers for non pointer deopt args"))
const BasicBlock * getParent() const
void LowerDeoptimizingReturn()
void markAsStatepointSpillSlotObjectIndex(int ObjectIdx)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
A SetVector that performs no allocations if smaller than a certain size.
@ DeoptLiveIn
Mark the deopt arguments associated with the statepoint as only being "live-in".
This class represents a function call, abstracting a target machine's calling convention.
void DeleteNode(SDNode *N)
Remove the specified node from the system.
MachineFunction & getMachineFunction() const
SDValue getExternalSymbol(const char *Sym, EVT VT)
size_t size() const
Returns the number of bits in this bitvector.
@ MaskAll
A bitmask that includes all valid flags.
EVT getValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const
Return the EVT corresponding to this LLVM type.
LLVM Value Representation.
const TargetMachine & getTarget() const
SDValue getRoot()
Similar to getMemoryRoot, but also flushes PendingConstrainedFP(Strict) items.
void ExportFromCurrentBlock(const Value *V)
ExportFromCurrentBlock - If this condition isn't known to be exported from the current basic block,...
void populateCallLoweringInfo(TargetLowering::CallLoweringInfo &CLI, const CallBase *Call, unsigned ArgIdx, unsigned NumArgs, SDValue Callee, Type *ReturnTy, bool IsPatchPoint)
Populate a CallLowerinInfo (into CLI) based on the properties of the call being lowered.
const GCStatepointInst * getStatepoint() const
The statepoint with which this gc.relocate is associated.
SDNode * getGluedNode() const
If this node has a glue operand, return the node to which the glue operand points.
SDValue getControlRoot()
Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports (...
static void lowerStatepointMetaArgs(SmallVectorImpl< SDValue > &Ops, SmallVectorImpl< MachineMemOperand * > &MemRefs, SmallVectorImpl< SDValue > &GCPtrs, DenseMap< SDValue, int > &LowerAsVReg, SelectionDAGBuilder::StatepointLoweringInfo &SI, SelectionDAGBuilder &Builder)
Lower deopt state and gc pointer arguments of the statepoint.
FunctionLoweringInfo::StatepointRelocationRecord RecordType
iterator insert(iterator I, T &&Elt)
GCFunctionInfo * GFI
Garbage collection metadata for the function.