14 #ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_SELECTIONDAGBUILDER_H
15 #define LLVM_LIB_CODEGEN_SELECTIONDAG_SELECTIONDAGBUILDER_H
33 class AddrSpaceCastInst;
40 class ExtractElementInst;
47 class FunctionLoweringInfo;
48 class GetElementPtrInst;
54 class InsertElementInst;
57 class MachineBasicBlock;
59 class MachineRegisterInfo;
68 class ShuffleVectorInst;
73 class TargetLibraryInfo;
77 class UnreachableInst;
96 class DanglingDebugInfo {
101 DanglingDebugInfo() : DI(
nullptr), dl(
DebugLoc()), SDNodeOrder(0) { }
103 : DI(di), dl(std::move(DL)), SDNodeOrder(SDNO) {}
106 unsigned getSDNodeOrder() {
return SDNodeOrder; }
134 unsigned SDNodeOrder;
136 enum CaseClusterKind {
148 CaseClusterKind
Kind;
152 unsigned JTCasesIndex;
153 unsigned BTCasesIndex;
155 BranchProbability Prob;
157 static CaseCluster range(
const ConstantInt *Low,
const ConstantInt *
High,
158 MachineBasicBlock *MBB, BranchProbability Prob) {
168 static CaseCluster jumpTable(
const ConstantInt *Low,
169 const ConstantInt *
High,
unsigned JTCasesIndex,
170 BranchProbability Prob) {
172 C.Kind = CC_JumpTable;
175 C.JTCasesIndex = JTCasesIndex;
180 static CaseCluster bitTests(
const ConstantInt *Low,
const ConstantInt *
High,
181 unsigned BTCasesIndex, BranchProbability Prob) {
183 C.Kind = CC_BitTests;
186 C.BTCasesIndex = BTCasesIndex;
192 typedef std::vector<CaseCluster> CaseClusterVector;
193 typedef CaseClusterVector::iterator CaseClusterIt;
197 MachineBasicBlock* BB;
199 BranchProbability ExtraProb;
201 CaseBits(uint64_t mask, MachineBasicBlock* bb,
unsigned bits,
202 BranchProbability Prob):
203 Mask(mask), BB(bb),
Bits(bits), ExtraProb(Prob) { }
205 CaseBits() :
Mask(0), BB(nullptr),
Bits(0) {}
208 typedef std::vector<CaseBits> CaseBitsVector;
211 void sortAndRangeify(CaseClusterVector &Clusters);
217 CaseBlock(
ISD::CondCode cc,
const Value *cmplhs,
const Value *cmprhs,
218 const Value *cmpmiddle, MachineBasicBlock *truebb,
219 MachineBasicBlock *falsebb, MachineBasicBlock *me,
222 : CC(cc), CmpLHS(cmplhs), CmpMHS(cmpmiddle), CmpRHS(cmprhs),
223 TrueBB(truebb), FalseBB(falsebb), ThisBB(me), TrueProb(trueprob),
224 FalseProb(falseprob) {}
232 const Value *CmpLHS, *CmpMHS, *CmpRHS;
235 MachineBasicBlock *TrueBB, *FalseBB;
238 MachineBasicBlock *ThisBB;
241 BranchProbability TrueProb, FalseProb;
245 JumpTable(
unsigned R,
unsigned J, MachineBasicBlock *M,
246 MachineBasicBlock *
D):
Reg(R), JTI(J), MBB(M),
Default(D) {}
254 MachineBasicBlock *MBB;
259 struct JumpTableHeader {
260 JumpTableHeader(APInt
F, APInt
L,
const Value *SV, MachineBasicBlock *
H,
262 : First(std::move(F)),
Last(std::move(L)), SValue(SV), HeaderBB(H),
267 MachineBasicBlock *HeaderBB;
270 typedef std::pair<JumpTableHeader, JumpTable> JumpTableBlock;
273 BitTestCase(uint64_t M, MachineBasicBlock*
T, MachineBasicBlock* Tr,
274 BranchProbability Prob):
275 Mask(M), ThisBB(T), TargetBB(Tr), ExtraProb(Prob) { }
277 MachineBasicBlock *ThisBB;
278 MachineBasicBlock *TargetBB;
279 BranchProbability ExtraProb;
282 typedef SmallVector<BitTestCase, 3> BitTestInfo;
284 struct BitTestBlock {
285 BitTestBlock(APInt
F, APInt R,
const Value *SV,
unsigned Rg, MVT RgVT,
286 bool E,
bool CR, MachineBasicBlock *
P, MachineBasicBlock *
D,
287 BitTestInfo
C, BranchProbability Pr)
288 : First(std::move(F)), Range(std::move(R)), SValue(SV),
Reg(Rg),
289 RegVT(RgVT), Emitted(E), ContiguousRange(CR), Parent(P),
Default(D),
290 Cases(std::move(C)), Prob(Pr) {}
297 bool ContiguousRange;
298 MachineBasicBlock *Parent;
301 BranchProbability Prob;
302 BranchProbability DefaultProb;
306 uint64_t getJumpTableRange(
const CaseClusterVector &Clusters,
unsigned First,
307 unsigned Last)
const;
310 uint64_t getJumpTableNumCases(
const SmallVectorImpl<unsigned> &TotalCases,
311 unsigned First,
unsigned Last)
const;
315 bool buildJumpTable(
const CaseClusterVector &Clusters,
unsigned First,
316 unsigned Last,
const SwitchInst *SI,
317 MachineBasicBlock *DefaultMBB, CaseCluster &JTCluster);
320 void findJumpTables(CaseClusterVector &Clusters,
const SwitchInst *SI,
321 MachineBasicBlock *DefaultMBB);
325 bool buildBitTests(CaseClusterVector &Clusters,
unsigned First,
unsigned Last,
326 const SwitchInst *SI, CaseCluster &BTCluster);
329 void findBitTestClusters(CaseClusterVector &Clusters,
const SwitchInst *SI);
331 struct SwitchWorkListItem {
332 MachineBasicBlock *MBB;
333 CaseClusterIt FirstCluster;
334 CaseClusterIt LastCluster;
335 const ConstantInt *
GE;
336 const ConstantInt *
LT;
337 BranchProbability DefaultProb;
339 typedef SmallVector<SwitchWorkListItem, 4> SwitchWorkList;
343 static unsigned caseClusterRank(
const CaseCluster &CC, CaseClusterIt First,
347 void splitWorkItem(SwitchWorkList &WorkList,
const SwitchWorkListItem &W,
348 Value *Cond, MachineBasicBlock *SwitchMBB);
351 void lowerWorkItem(SwitchWorkListItem W, Value *Cond,
352 MachineBasicBlock *SwitchMBB,
353 MachineBasicBlock *DefaultMBB);
467 class StackProtectorDescriptor {
469 StackProtectorDescriptor()
470 : ParentMBB(nullptr), SuccessMBB(nullptr), FailureMBB(nullptr) {}
474 bool shouldEmitStackProtector()
const {
475 return ParentMBB && SuccessMBB && FailureMBB;
478 bool shouldEmitFunctionBasedCheckStackProtector()
const {
479 return ParentMBB && !SuccessMBB && !FailureMBB;
485 bool FunctionBasedInstrumentation) {
487 assert(!shouldEmitStackProtector() &&
"Stack Protector Descriptor is "
488 "already initialized!");
490 if (!FunctionBasedInstrumentation) {
491 SuccessMBB = AddSuccessorMBB(BB, MBB,
true);
492 FailureMBB = AddSuccessorMBB(BB, MBB,
false, FailureMBB);
506 void resetPerBBState() {
508 SuccessMBB =
nullptr;
520 void resetPerFunctionState() {
521 FailureMBB =
nullptr;
524 MachineBasicBlock *getParentMBB() {
return ParentMBB; }
525 MachineBasicBlock *getSuccessMBB() {
return SuccessMBB; }
526 MachineBasicBlock *getFailureMBB() {
return FailureMBB; }
536 MachineBasicBlock *ParentMBB;
540 MachineBasicBlock *SuccessMBB;
544 MachineBasicBlock *FailureMBB;
549 MachineBasicBlock *AddSuccessorMBB(
const BasicBlock *BB,
550 MachineBasicBlock *ParentMBB,
552 MachineBasicBlock *SuccMBB =
nullptr);
556 const TargetMachine &TM;
636 return SDLoc(CurInst, SDNodeOrder);
664 assert(!N.
getNode() &&
"Already set a value for this node!");
670 assert(!N.
getNode() &&
"Already set a value for this node!");
699 unsigned NumArgs,
SDValue Callee,
700 Type *ReturnTy,
bool IsPatchPoint);
702 std::pair<SDValue, SDValue>
770 bool VarArgDisallowed,
771 bool ForceVoidReturnTy);
793 void addSuccessorWithProb(
819 void visitBinary(
const User &
I,
unsigned OpCode);
820 void visitShift(
const User &
I,
unsigned Opcode);
822 void visitFAdd(
const User &
I) { visitBinary(I,
ISD::FADD); }
823 void visitSub(
const User &
I) { visitBinary(I,
ISD::SUB); }
824 void visitFSub(
const User &
I);
825 void visitMul(
const User &
I) { visitBinary(I,
ISD::MUL); }
826 void visitFMul(
const User &
I) { visitBinary(I,
ISD::FMUL); }
827 void visitURem(
const User &
I) { visitBinary(I,
ISD::UREM); }
828 void visitSRem(
const User &
I) { visitBinary(I,
ISD::SREM); }
829 void visitFRem(
const User &
I) { visitBinary(I,
ISD::FREM); }
830 void visitUDiv(
const User &
I) { visitBinary(I,
ISD::UDIV); }
831 void visitSDiv(
const User &
I);
832 void visitFDiv(
const User &
I) { visitBinary(I,
ISD::FDIV); }
833 void visitAnd (
const User &
I) { visitBinary(I,
ISD::AND); }
834 void visitOr (
const User &
I) { visitBinary(I,
ISD::OR); }
835 void visitXor (
const User &
I) { visitBinary(I,
ISD::XOR); }
836 void visitShl (
const User &
I) { visitShift(I,
ISD::SHL); }
837 void visitLShr(
const User &
I) { visitShift(I,
ISD::SRL); }
838 void visitAShr(
const User &
I) { visitShift(I,
ISD::SRA); }
839 void visitICmp(
const User &
I);
840 void visitFCmp(
const User &
I);
842 void visitTrunc(
const User &
I);
843 void visitZExt(
const User &
I);
844 void visitSExt(
const User &
I);
845 void visitFPTrunc(
const User &
I);
846 void visitFPExt(
const User &
I);
847 void visitFPToUI(
const User &
I);
848 void visitFPToSI(
const User &
I);
849 void visitUIToFP(
const User &
I);
850 void visitSIToFP(
const User &
I);
851 void visitPtrToInt(
const User &
I);
852 void visitIntToPtr(
const User &
I);
853 void visitBitCast(
const User &
I);
854 void visitAddrSpaceCast(
const User &
I);
856 void visitExtractElement(
const User &
I);
857 void visitInsertElement(
const User &
I);
858 void visitShuffleVector(
const User &
I);
860 void visitExtractValue(
const User &
I);
861 void visitInsertValue(
const User &
I);
862 void visitLandingPad(
const LandingPadInst &
I);
864 void visitGetElementPtr(
const User &
I);
865 void visitSelect(
const User &
I);
867 void visitAlloca(
const AllocaInst &
I);
868 void visitLoad(
const LoadInst &
I);
869 void visitStore(
const StoreInst &
I);
870 void visitMaskedLoad(
const CallInst &
I,
bool IsExpanding =
false);
871 void visitMaskedStore(
const CallInst &
I,
bool IsCompressing =
false);
872 void visitMaskedGather(
const CallInst &
I);
873 void visitMaskedScatter(
const CallInst &
I);
874 void visitAtomicCmpXchg(
const AtomicCmpXchgInst &
I);
875 void visitAtomicRMW(
const AtomicRMWInst &
I);
876 void visitFence(
const FenceInst &
I);
877 void visitPHI(
const PHINode &
I);
878 void visitCall(
const CallInst &
I);
879 bool visitMemCmpCall(
const CallInst &
I);
880 bool visitMemPCpyCall(
const CallInst &
I);
881 bool visitMemChrCall(
const CallInst &
I);
882 bool visitStrCpyCall(
const CallInst &
I,
bool isStpcpy);
883 bool visitStrCmpCall(
const CallInst &
I);
884 bool visitStrLenCall(
const CallInst &
I);
885 bool visitStrNLenCall(
const CallInst &
I);
886 bool visitUnaryFloatCall(
const CallInst &
I,
unsigned Opcode);
887 bool visitBinaryFloatCall(
const CallInst &
I,
unsigned Opcode);
888 void visitAtomicLoad(
const LoadInst &
I);
889 void visitAtomicStore(
const StoreInst &
I);
890 void visitLoadFromSwiftError(
const LoadInst &
I);
891 void visitStoreToSwiftError(
const StoreInst &
I);
893 void visitInlineAsm(ImmutableCallSite CS);
894 const char *visitIntrinsicCall(
const CallInst &
I,
unsigned Intrinsic);
895 void visitTargetIntrinsic(
const CallInst &
I,
unsigned Intrinsic);
896 void visitConstrainedFPIntrinsic(
const ConstrainedFPIntrinsic &FPI);
898 void visitVAStart(
const CallInst &
I);
899 void visitVAArg(
const VAArgInst &
I);
900 void visitVAEnd(
const CallInst &
I);
901 void visitVACopy(
const CallInst &
I);
902 void visitStackmap(
const CallInst &
I);
903 void visitPatchpoint(ImmutableCallSite CS,
907 void visitGCRelocate(
const GCRelocateInst &
I);
908 void visitGCResult(
const GCResultInst &
I);
910 void visitVectorReduce(
const CallInst &
I,
unsigned Intrinsic);
912 void visitUserOp1(
const Instruction &
I) {
913 llvm_unreachable(
"UserOp1 should not exist at instruction selection time!");
915 void visitUserOp2(
const Instruction &
I) {
916 llvm_unreachable(
"UserOp2 should not exist at instruction selection time!");
919 void processIntegerCallValue(
const Instruction &
I,
920 SDValue Value,
bool IsSigned);
922 void HandlePHINodesInSuccessorBlocks(
const BasicBlock *LLVMBB);
924 void emitInlineAsmError(ImmutableCallSite CS,
const Twine &Message);
929 bool EmitFuncArgumentDbgValue(
const Value *V, DILocalVariable *Variable,
930 DIExpression *Expr, DILocation *
DL,
931 int64_t
Offset,
bool IsDbgDeclare,
935 MachineBasicBlock *NextBlock(MachineBasicBlock *MBB);
939 void updateDAGForMaybeTailCall(SDValue MaybeTC);
942 SDDbgValue *getDbgValue(SDValue
N, DILocalVariable *Variable,
943 DIExpression *Expr, int64_t
Offset,
944 const DebugLoc &dl,
unsigned DbgSDNodeOrder);
986 bool IsABIMangledValue =
false);
990 bool IsABIMangledValue =
false);
1006 const Value *V =
nullptr)
const;
1021 unsigned MatchingIdx,
const SDLoc &dl,
Return a value (possibly void), from a function.
std::vector< BitTestBlock > BitTestCases
BitTestCases - Vector of BitTestBlock structures used to communicate SwitchInst code generation infor...
void push_back(const T &Elt)
A parsed version of the target data layout string in and methods for querying it. ...
bool findValue(const Value *V) const
void ExportFromCurrentBlock(const Value *V)
ExportFromCurrentBlock - If this condition isn't known to be exported from the current basic block...
const TargetLibraryInfo * LibInfo
StatepointFlags
The statepoint intrinsic accepts a set of flags as its third argument.
void LowerDeoptimizeCall(const CallInst *CI)
TargetLowering::CallLoweringInfo CLI
Information regarding the underlying call instruction.
void CopyValueToVirtualRegister(const Value *V, unsigned Reg)
SmallVector< const GCRelocateInst *, 16 > GCRelocates
The set of gc.relocate calls associated with this gc.statepoint.
SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameter...
A specialization of it's base class for read only access to a gc.statepoint.
void LowerStatepoint(ImmutableStatepoint Statepoint, const BasicBlock *EHPadBB=nullptr)
SelectionDAGBuilder(SelectionDAG &dag, FunctionLoweringInfo &funcinfo, CodeGenOpt::Level ol)
This class represents a function call, abstracting a target machine's calling convention.
void LowerDeoptimizingReturn()
void setValue(const Value *V, SDValue NewN)
void visitJumpTableHeader(JumpTable &JT, JumpTableHeader &JTH, MachineBasicBlock *SwitchBB)
visitJumpTableHeader - This function emits necessary code to produce index in the JumpTable from swit...
SDValue getValueImpl(const Value *V)
getValueImpl - Helper function for getValue and getNonRegisterValue.
DebugLoc getCurDebugLoc() const
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
bool IsABIMangled
Records if this value needs to be treated in an ABI dependant manner, different to normal type legali...
SDValue getValue(const Value *V)
getValue - Return an SDValue for the given Value.
unsigned ID
The ID that the resulting STATEPOINT instruction has to report.
StackProtectorDescriptor SPDescriptor
A StackProtectorDescriptor structure used to communicate stack protector information in between Selec...
void visitSPDescriptorParent(StackProtectorDescriptor &SPD, MachineBasicBlock *ParentBB)
Codegen a new tail for a stack protector check ParentMBB which has had its tail spliced into a stack ...
SDValue getRoot()
Return the current virtual root of the Selection DAG, flushing any PendingLoad items.
void AddInlineAsmOperands(unsigned Kind, bool HasMatching, unsigned MatchingIdx, const SDLoc &dl, SelectionDAG &DAG, std::vector< SDValue > &Ops) const
Add this value to the specified inlineasm node operand list.
void visitSwitchCase(CaseBlock &CB, MachineBasicBlock *SwitchBB)
visitSwitchCase - Emits the necessary code to represent a single node in the binary search tree resul...
StatepointLoweringInfo(SelectionDAG &DAG)
Shift and rotation operations.
void visitJumpTable(JumpTable &JT)
visitJumpTable - Emit JumpTable node in the current MBB
ArrayRef< const Use > GCTransitionArgs
The list of gc transition arguments present in the gc.statepoint being lowered.
SmallVector< EVT, 4 > ValueVTs
The value types of the values, which may not be legal, and may need be promoted or synthesized from o...
Reg
All possible values of the reg field in the ModR/M byte.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
void LowerCallSiteWithDeoptBundle(ImmutableCallSite CS, SDValue Callee, const BasicBlock *EHPadBB)
This file implements a class to represent arbitrary precision integral constant values and operations...
Simple integer binary arithmetic operators.
SDValue getNonRegisterValue(const Value *V)
getNonRegisterValue - Return an SDValue for the given Value, but don't look in FuncInfo.ValueMap for a virtual register.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
bool ShouldEmitAsBranches(const std::vector< CaseBlock > &Cases)
If the set of cases should be emitted as a series of branches, return true.
SDValue lowerRangeToAssertZExt(SelectionDAG &DAG, const Instruction &I, SDValue Op)
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
void init(GCFunctionInfo *gfi, AliasAnalysis *AA, const TargetLibraryInfo *li)
void populateCallLoweringInfo(TargetLowering::CallLoweringInfo &CLI, ImmutableCallSite CS, 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 DataLayout & getDataLayout() const
void append(const RegsForValue &RHS)
Add the specified values to this one.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
SDNode * getNode() const
get the SDNode which holds the desired result
Function Alias Analysis false
std::pair< SDValue, SDValue > lowerInvokable(TargetLowering::CallLoweringInfo &CLI, const BasicBlock *EHPadBB=nullptr)
const Instruction * StatepointInstr
The gc.statepoint instruction.
SDValue getCopyFromRegs(SelectionDAG &DAG, FunctionLoweringInfo &FuncInfo, const SDLoc &dl, SDValue &Chain, SDValue *Flag, const Value *V=nullptr) const
Emit a series of CopyFromReg nodes that copies from this value and returns the result as a ValueVTs v...
bool HasTailCall
HasTailCall - This is set to true if a call in the current block has been translated as a tail call...
ArrayRef< const Use > DeoptState
The deoptimization state associated with this gc.statepoint call, if any.
LLVM Basic Block Representation.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
Simple binary floating point operators.
Conditional or Unconditional Branch instruction.
This function has undefined behavior.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
Resume the propagation of an exception.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Indirect Branch Instruction.
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
This class tracks both per-statepoint and per-selectiondag information.
A specialization of it's base class for read-write access to a gc.statepoint.
SDLoc getCurSDLoc() const
void FindMergedConditions(const Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, MachineBasicBlock *SwitchBB, Instruction::BinaryOps Opc, BranchProbability TW, BranchProbability FW, bool InvertCond)
FindMergedConditions - If Cond is an expression like.
This structure contains all information that is necessary for lowering calls.
void EmitBranchForMergedCondition(const Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, MachineBasicBlock *SwitchBB, BranchProbability TW, BranchProbability FW, bool InvertCond)
EmitBranchForMergedCondition - Helper method for FindMergedConditions.
void CopyToExportRegsIfNeeded(const Value *V)
CopyToExportRegsIfNeeded - If the given value has virtual registers created for it, emit nodes to copy the value into the virtual registers.
static BranchProbability getUnknown()
void visitSPDescriptorFailure(StackProtectorDescriptor &SPD)
Codegen the failure basic block for a stack protector check.
This is the shared class of boolean and integer constants.
SmallVector< unsigned, 4 > RegCount
This list holds the number of registers for each value.
SDValue LowerAsSTATEPOINT(StatepointLoweringInfo &SLI)
Lower SLI into a STATEPOINT instruction.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
RegsForValue - This struct represents the registers (physical or virtual) that a particular set of va...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Provides information about what library functions are available for the current target.
void clear()
Clear out the current SelectionDAG and the associated state and prepare this SelectionDAGBuilder obje...
void visit(const Instruction &I)
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
void UpdateSplitBlock(MachineBasicBlock *First, MachineBasicBlock *Last)
UpdateSplitBlock - When an MBB was split during scheduling, update the references that need to refer ...
GCFunctionInfo * GFI
GFI - Garbage collection metadata for the function.
static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, ArrayRef< StringRef > StandardNames)
initialize - Initialize the set of available library functions based on the specified target triple...
void visitBitTestCase(BitTestBlock &BB, MachineBasicBlock *NextMBB, BranchProbability BranchProbToNext, unsigned Reg, BitTestCase &B, MachineBasicBlock *SwitchBB)
visitBitTestCase - this function produces one "bit test"
std::vector< JumpTableBlock > JTCases
JTCases - Vector of JumpTable structures used to communicate SwitchInst code generation information...
ANY_EXTEND - Used for integer types. The high bits are undefined.
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
llvm_unreachable("Unknown RegBank!")
SmallVector< SDValue, 8 > PendingLoads
PendingLoads - Loads are not emitted to the program immediately.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
Bitwise operators - logical and, logical or, logical xor.
This represents the llvm.dbg.value instruction.
Establish a view to a call site for examination.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
SmallVector< const Value *, 16 > Bases
Bases[i] is the base pointer for Ptrs[i].
StatepointLoweringState StatepointLowering
State used while lowering a statepoint sequence (gc_statepoint, gc_relocate, and gc_result).
SDValue getCopyFromRegs(const Value *V, Type *Ty)
getCopyFromRegs - If there was virtual register allocated for the value V emit CopyFromReg of the spe...
MVT getFrameIndexTy(const DataLayout &DL) const
Return the type for frame index, which is determined by the alloca address space specified through th...
void LowerCallTo(ImmutableCallSite CS, SDValue Callee, bool IsTailCall, const BasicBlock *EHPadBB=nullptr)
unsigned NumPatchBytes
The number of patchable bytes the call needs to get lowered into.
void LowerCallSiteWithDeoptBundleImpl(ImmutableCallSite CS, SDValue Callee, const BasicBlock *EHPadBB, bool VarArgDisallowed, bool ForceVoidReturnTy)
FunctionLoweringInfo & FuncInfo
FuncInfo - Information about the function as a whole.
SmallVector< MVT, 4 > RegVTs
The value types of the registers.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const BasicBlock * EHPadBB
The exception handling unwind destination, in case this represents an invoke of gc.statepoint.
void setUnusedArgValue(const Value *V, SDValue NewN)
LLVM Value Representation.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
ArrayRef< const Use > GCArgs
The full list of gc arguments to the gc.statepoint being lowered.
const TargetLowering & getTargetLoweringInfo() const
MVT getFrameIndexTy()
Returns the type of FrameIndex and TargetFrameIndex nodes.
std::vector< CaseBlock > SwitchCases
SwitchCases - Vector of CaseBlock structures used to communicate SwitchInst code generation informati...
SDValue getControlRoot()
Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports i...
Garbage collection metadata for a single function.
void clearDanglingDebugInfo()
Clear the dangling debug information map.
DenseMap< MachineBasicBlock *, SmallVector< unsigned, 4 > > LPadToCallSiteMap
LPadToCallSiteMap - Map a landing pad to the call site indexes.
DenseMap< const Constant *, unsigned > ConstantsOut
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
bool isExportableFromCurrentBlock(const Value *V, const BasicBlock *FromBB)
SmallVector< unsigned, 4 > Regs
This list holds the registers assigned to the values.
void visitBitTestHeader(BitTestBlock &B, MachineBasicBlock *SwitchBB)
visitBitTestHeader - This function emits necessary code to produce value suitable for "bit tests" ...
SmallVector< const Value *, 16 > Ptrs
static const unsigned LowestSDNodeOrder
Lowest valid SDNodeOrder.
void resolveDanglingDebugInfo(const Value *V, SDValue Val)
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...
Describes a gc.statepoint or a gc.statepoint like thing for the purposes of lowering into a STATEPOIN...
This file describes how to lower LLVM code to machine code.