14 #ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_SELECTIONDAGBUILDER_H
15 #define LLVM_LIB_CODEGEN_SELECTIONDAG_SELECTIONDAGBUILDER_H
33 class AddrSpaceCastInst;
40 class ExtractElementInst;
41 class ExtractValueInst;
48 class FunctionLoweringInfo;
49 class GetElementPtrInst;
55 class InsertElementInst;
56 class InsertValueInst;
59 class MachineBasicBlock;
61 class MachineRegisterInfo;
70 class ShuffleVectorInst;
75 class TargetLibraryInfo;
79 class UnreachableInst;
98 class DanglingDebugInfo {
101 unsigned SDNodeOrder;
103 DanglingDebugInfo() : DI(
nullptr), dl(
DebugLoc()), SDNodeOrder(0) { }
105 : DI(di), dl(std::move(DL)), SDNodeOrder(SDNO) {}
108 unsigned getSDNodeOrder() {
return SDNodeOrder; }
136 unsigned SDNodeOrder;
138 enum CaseClusterKind {
150 CaseClusterKind
Kind;
154 unsigned JTCasesIndex;
155 unsigned BTCasesIndex;
157 BranchProbability Prob;
159 static CaseCluster range(
const ConstantInt *Low,
const ConstantInt *
High,
160 MachineBasicBlock *
MBB, BranchProbability Prob) {
170 static CaseCluster jumpTable(
const ConstantInt *Low,
171 const ConstantInt *
High,
unsigned JTCasesIndex,
172 BranchProbability Prob) {
174 C.Kind = CC_JumpTable;
177 C.JTCasesIndex = JTCasesIndex;
182 static CaseCluster bitTests(
const ConstantInt *Low,
const ConstantInt *
High,
183 unsigned BTCasesIndex, BranchProbability Prob) {
185 C.Kind = CC_BitTests;
188 C.BTCasesIndex = BTCasesIndex;
194 typedef std::vector<CaseCluster> CaseClusterVector;
195 typedef CaseClusterVector::iterator CaseClusterIt;
199 MachineBasicBlock* BB;
201 BranchProbability ExtraProb;
203 CaseBits(uint64_t mask, MachineBasicBlock* bb,
unsigned bits,
204 BranchProbability Prob):
205 Mask(mask), BB(bb),
Bits(bits), ExtraProb(Prob) { }
207 CaseBits() :
Mask(0), BB(nullptr),
Bits(0) {}
210 typedef std::vector<CaseBits> CaseBitsVector;
213 void sortAndRangeify(CaseClusterVector &Clusters);
219 CaseBlock(
ISD::CondCode cc,
const Value *cmplhs,
const Value *cmprhs,
220 const Value *cmpmiddle, MachineBasicBlock *truebb,
221 MachineBasicBlock *falsebb, MachineBasicBlock *me,
224 : CC(cc), CmpLHS(cmplhs), CmpMHS(cmpmiddle), CmpRHS(cmprhs),
225 TrueBB(truebb), FalseBB(falsebb), ThisBB(me), TrueProb(trueprob),
226 FalseProb(falseprob) {}
234 const Value *CmpLHS, *CmpMHS, *CmpRHS;
237 MachineBasicBlock *TrueBB, *FalseBB;
240 MachineBasicBlock *ThisBB;
243 BranchProbability TrueProb, FalseProb;
247 JumpTable(
unsigned R,
unsigned J, MachineBasicBlock *M,
256 MachineBasicBlock *
MBB;
261 struct JumpTableHeader {
262 JumpTableHeader(APInt
F, APInt
L,
const Value *SV, MachineBasicBlock *
H,
264 : First(std::move(F)),
Last(std::move(L)), SValue(SV), HeaderBB(H),
269 MachineBasicBlock *HeaderBB;
272 typedef std::pair<JumpTableHeader, JumpTable> JumpTableBlock;
275 BitTestCase(uint64_t M, MachineBasicBlock*
T, MachineBasicBlock* Tr,
276 BranchProbability Prob):
277 Mask(M), ThisBB(T), TargetBB(Tr), ExtraProb(Prob) { }
279 MachineBasicBlock *ThisBB;
280 MachineBasicBlock *TargetBB;
281 BranchProbability ExtraProb;
284 typedef SmallVector<BitTestCase, 3> BitTestInfo;
286 struct BitTestBlock {
287 BitTestBlock(APInt
F, APInt R,
const Value *SV,
unsigned Rg, MVT RgVT,
288 bool E,
bool CR, MachineBasicBlock *
P, MachineBasicBlock *
D,
289 BitTestInfo
C, BranchProbability Pr)
290 : First(std::move(F)), Range(std::move(R)), SValue(SV),
Reg(Rg),
291 RegVT(RgVT), Emitted(E), ContiguousRange(CR), Parent(P),
Default(D),
292 Cases(std::move(C)), Prob(Pr) {}
299 bool ContiguousRange;
300 MachineBasicBlock *Parent;
303 BranchProbability Prob;
304 BranchProbability DefaultProb;
308 bool isDense(
const CaseClusterVector &Clusters,
309 const SmallVectorImpl<unsigned> &TotalCases,
310 unsigned First,
unsigned Last,
unsigned MinDensity)
const;
314 bool buildJumpTable(
const CaseClusterVector &Clusters,
unsigned First,
315 unsigned Last,
const SwitchInst *SI,
316 MachineBasicBlock *DefaultMBB, CaseCluster &JTCluster);
319 void findJumpTables(CaseClusterVector &Clusters,
const SwitchInst *SI,
320 MachineBasicBlock *DefaultMBB);
323 bool rangeFitsInWord(
const APInt &Low,
const APInt &
High);
327 bool isSuitableForBitTests(
unsigned NumDests,
unsigned NumCmps,
328 const APInt &Low,
const APInt &
High);
332 bool buildBitTests(CaseClusterVector &Clusters,
unsigned First,
unsigned Last,
333 const SwitchInst *SI, CaseCluster &BTCluster);
336 void findBitTestClusters(CaseClusterVector &Clusters,
const SwitchInst *SI);
338 struct SwitchWorkListItem {
339 MachineBasicBlock *
MBB;
340 CaseClusterIt FirstCluster;
341 CaseClusterIt LastCluster;
342 const ConstantInt *
GE;
343 const ConstantInt *
LT;
344 BranchProbability DefaultProb;
346 typedef SmallVector<SwitchWorkListItem, 4> SwitchWorkList;
350 static unsigned caseClusterRank(
const CaseCluster &CC, CaseClusterIt First,
354 void splitWorkItem(SwitchWorkList &WorkList,
const SwitchWorkListItem &W,
355 Value *Cond, MachineBasicBlock *SwitchMBB);
358 void lowerWorkItem(SwitchWorkListItem W, Value *Cond,
359 MachineBasicBlock *SwitchMBB,
360 MachineBasicBlock *DefaultMBB);
474 class StackProtectorDescriptor {
476 StackProtectorDescriptor()
477 : ParentMBB(nullptr), SuccessMBB(nullptr), FailureMBB(nullptr) {}
481 bool shouldEmitStackProtector()
const {
482 return ParentMBB && SuccessMBB && FailureMBB;
485 bool shouldEmitFunctionBasedCheckStackProtector()
const {
486 return ParentMBB && !SuccessMBB && !FailureMBB;
492 bool FunctionBasedInstrumentation) {
494 assert(!shouldEmitStackProtector() &&
"Stack Protector Descriptor is "
495 "already initialized!");
497 if (!FunctionBasedInstrumentation) {
498 SuccessMBB = AddSuccessorMBB(BB, MBB,
true);
499 FailureMBB = AddSuccessorMBB(BB, MBB,
false, FailureMBB);
513 void resetPerBBState() {
515 SuccessMBB =
nullptr;
527 void resetPerFunctionState() {
528 FailureMBB =
nullptr;
531 MachineBasicBlock *getParentMBB() {
return ParentMBB; }
532 MachineBasicBlock *getSuccessMBB() {
return SuccessMBB; }
533 MachineBasicBlock *getFailureMBB() {
return FailureMBB; }
543 MachineBasicBlock *ParentMBB;
547 MachineBasicBlock *SuccessMBB;
551 MachineBasicBlock *FailureMBB;
556 MachineBasicBlock *AddSuccessorMBB(
const BasicBlock *BB,
557 MachineBasicBlock *ParentMBB,
559 MachineBasicBlock *SuccMBB =
nullptr);
563 const TargetMachine &TM;
649 return SDLoc(CurInst, SDNodeOrder);
677 assert(!N.
getNode() &&
"Already set a value for this node!");
683 assert(!N.
getNode() &&
"Already set a value for this node!");
711 unsigned NumArgs,
SDValue Callee,
712 Type *ReturnTy,
bool IsPatchPoint);
714 std::pair<SDValue, SDValue>
782 bool VarArgDisallowed,
783 bool ForceVoidReturnTy);
800 void addSuccessorWithProb(
826 void visitBinary(
const User &
I,
unsigned OpCode);
827 void visitShift(
const User &
I,
unsigned Opcode);
829 void visitFAdd(
const User &
I) { visitBinary(I,
ISD::FADD); }
830 void visitSub(
const User &
I) { visitBinary(I,
ISD::SUB); }
831 void visitFSub(
const User &
I);
832 void visitMul(
const User &
I) { visitBinary(I,
ISD::MUL); }
833 void visitFMul(
const User &
I) { visitBinary(I,
ISD::FMUL); }
834 void visitURem(
const User &
I) { visitBinary(I,
ISD::UREM); }
835 void visitSRem(
const User &
I) { visitBinary(I,
ISD::SREM); }
836 void visitFRem(
const User &
I) { visitBinary(I,
ISD::FREM); }
837 void visitUDiv(
const User &
I) { visitBinary(I,
ISD::UDIV); }
838 void visitSDiv(
const User &
I);
839 void visitFDiv(
const User &
I) { visitBinary(I,
ISD::FDIV); }
840 void visitAnd (
const User &
I) { visitBinary(I,
ISD::AND); }
841 void visitOr (
const User &
I) { visitBinary(I,
ISD::OR); }
842 void visitXor (
const User &
I) { visitBinary(I,
ISD::XOR); }
843 void visitShl (
const User &
I) { visitShift(I,
ISD::SHL); }
844 void visitLShr(
const User &
I) { visitShift(I,
ISD::SRL); }
845 void visitAShr(
const User &
I) { visitShift(I,
ISD::SRA); }
846 void visitICmp(
const User &
I);
847 void visitFCmp(
const User &
I);
849 void visitTrunc(
const User &
I);
850 void visitZExt(
const User &
I);
851 void visitSExt(
const User &
I);
852 void visitFPTrunc(
const User &
I);
853 void visitFPExt(
const User &
I);
854 void visitFPToUI(
const User &
I);
855 void visitFPToSI(
const User &
I);
856 void visitUIToFP(
const User &
I);
857 void visitSIToFP(
const User &
I);
858 void visitPtrToInt(
const User &
I);
859 void visitIntToPtr(
const User &
I);
860 void visitBitCast(
const User &
I);
861 void visitAddrSpaceCast(
const User &
I);
863 void visitExtractElement(
const User &
I);
864 void visitInsertElement(
const User &
I);
865 void visitShuffleVector(
const User &
I);
867 void visitExtractValue(
const ExtractValueInst &
I);
868 void visitInsertValue(
const InsertValueInst &
I);
869 void visitLandingPad(
const LandingPadInst &
I);
871 void visitGetElementPtr(
const User &
I);
872 void visitSelect(
const User &
I);
874 void visitAlloca(
const AllocaInst &
I);
875 void visitLoad(
const LoadInst &
I);
876 void visitStore(
const StoreInst &
I);
877 void visitMaskedLoad(
const CallInst &
I,
bool IsExpanding =
false);
878 void visitMaskedStore(
const CallInst &
I,
bool IsCompressing =
false);
879 void visitMaskedGather(
const CallInst &
I);
880 void visitMaskedScatter(
const CallInst &
I);
881 void visitAtomicCmpXchg(
const AtomicCmpXchgInst &
I);
882 void visitAtomicRMW(
const AtomicRMWInst &
I);
883 void visitFence(
const FenceInst &
I);
884 void visitPHI(
const PHINode &
I);
885 void visitCall(
const CallInst &
I);
886 bool visitMemCmpCall(
const CallInst &
I);
887 bool visitMemPCpyCall(
const CallInst &
I);
888 bool visitMemChrCall(
const CallInst &
I);
889 bool visitStrCpyCall(
const CallInst &
I,
bool isStpcpy);
890 bool visitStrCmpCall(
const CallInst &
I);
891 bool visitStrLenCall(
const CallInst &
I);
892 bool visitStrNLenCall(
const CallInst &
I);
893 bool visitUnaryFloatCall(
const CallInst &
I,
unsigned Opcode);
894 bool visitBinaryFloatCall(
const CallInst &
I,
unsigned Opcode);
895 void visitAtomicLoad(
const LoadInst &
I);
896 void visitAtomicStore(
const StoreInst &
I);
897 void visitLoadFromSwiftError(
const LoadInst &
I);
898 void visitStoreToSwiftError(
const StoreInst &
I);
900 void visitInlineAsm(ImmutableCallSite CS);
901 const char *visitIntrinsicCall(
const CallInst &
I,
unsigned Intrinsic);
902 void visitTargetIntrinsic(
const CallInst &
I,
unsigned Intrinsic);
904 void visitVAStart(
const CallInst &
I);
905 void visitVAArg(
const VAArgInst &
I);
906 void visitVAEnd(
const CallInst &
I);
907 void visitVACopy(
const CallInst &
I);
908 void visitStackmap(
const CallInst &
I);
909 void visitPatchpoint(ImmutableCallSite CS,
913 void visitGCRelocate(
const GCRelocateInst &
I);
914 void visitGCResult(
const GCResultInst &
I);
916 void visitUserOp1(
const Instruction &
I) {
917 llvm_unreachable(
"UserOp1 should not exist at instruction selection time!");
919 void visitUserOp2(
const Instruction &
I) {
920 llvm_unreachable(
"UserOp2 should not exist at instruction selection time!");
923 void processIntegerCallValue(
const Instruction &
I,
924 SDValue Value,
bool IsSigned);
926 void HandlePHINodesInSuccessorBlocks(
const BasicBlock *LLVMBB);
928 void emitInlineAsmError(ImmutableCallSite CS,
const Twine &Message);
933 bool EmitFuncArgumentDbgValue(
const Value *V, DILocalVariable *Variable,
934 DIExpression *Expr, DILocation *
DL,
935 int64_t
Offset,
bool IsIndirect,
939 MachineBasicBlock *NextBlock(MachineBasicBlock *MBB);
943 void updateDAGForMaybeTailCall(SDValue MaybeTC);
946 SDDbgValue *getDbgValue(SDValue
N, DILocalVariable *Variable,
947 DIExpression *Expr, int64_t
Offset, DebugLoc dl,
948 unsigned DbgSDNodeOrder);
1003 const Value *V =
nullptr)
const;
1018 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...
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.
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()
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
AddInlineAsmOperands - 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 EmitBranchForMergedCondition(const Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, MachineBasicBlock *SwitchBB, BranchProbability TW, BranchProbability FW)
EmitBranchForMergedCondition - Helper method for FindMergedConditions.
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.
static GCRegistry::Add< StatepointGC > D("statepoint-example","an example strategy for statepoint")
SmallVector< EVT, 4 > ValueVTs
ValueVTs - The value types of the values, which may not be legal, and may need be promoted or synthes...
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.
Function Alias Analysis false
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)
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
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.
void append(const RegsForValue &RHS)
append - Add the specified values to this one.
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
Flag
These should be considered private to the implementation of the MCInstrDesc class.
SDNode * getNode() const
get the SDNode which holds the desired result
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
getCopyFromRegs - Emit a series of CopyFromReg nodes that copies from this value and returns the resu...
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.
MVT - Machine Value Type.
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 append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
EVT - Extended Value Type.
This structure contains all information that is necessary for lowering calls.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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.
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 - Clear out the current SelectionDAG and the associated state and prepare this SelectionDAGBuil...
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 ...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
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.
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.
ImmutableCallSite - establish a view to a call site for examination.
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...
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
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.
void init(GCFunctionInfo *gfi, AliasAnalysis &aa, const TargetLibraryInfo *li)
void FindMergedConditions(const Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, MachineBasicBlock *SwitchBB, Instruction::BinaryOps Opc, BranchProbability TW, BranchProbability FW)
FindMergedConditions - If Cond is an expression like.
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.
std::vector< CaseBlock > SwitchCases
SwitchCases - Vector of CaseBlock structures used to communicate SwitchInst code generation informati...
SDValue getControlRoot()
getControlRoot - Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports items.
Garbage collection metadata for a single function.
void clearDanglingDebugInfo()
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
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
getCopyToRegs - Emit a series of CopyToReg nodes that copies the specified value into the registers s...
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.