15 #ifndef LLVM_CODEGEN_SELECTIONDAG_H 16 #define LLVM_CODEGEN_SELECTIONDAG_H 71 class MachineBasicBlock;
72 class MachineConstantPoolValue;
74 class OptimizationRemarkEmitter;
78 class SelectionDAGTargetInfo;
79 class TargetLibraryInfo;
82 class TargetSubtargetInfo;
102 FastID(ID), VTs(VT), NumVTs(Num) {
121 if (X.HashValue != IDHash)
123 return ID == X.FastID;
166 DbgValMap[
Node].push_back(V);
180 ByvalParmDbgValues.
clear();
188 return DbgValues.
empty() && ByvalParmDbgValues.
empty() && DbgLabels.
empty();
193 if (I != DbgValMap.
end())
228 Pass *SDAGISelPass =
nullptr;
262 BumpPtrAllocator OperandAllocator;
271 uint16_t NextPersistentId = 0;
285 : Next(D.UpdateListeners), DAG(D) {
286 DAG.UpdateListeners =
this;
290 assert(DAG.UpdateListeners ==
this &&
291 "DAGUpdateListeners must be destroyed in LIFO order");
292 DAG.UpdateListeners = Next;
297 virtual void NodeDeleted(SDNode *
N, SDNode *
E);
300 virtual void NodeUpdated(SDNode *N);
318 bool NewNodesMustHaveLegalTypes =
false;
330 bool setSubgraphColorHelper(SDNode *
N,
const char *
Color,
332 int level,
bool &printed);
334 template <
typename SDNodeT,
typename... ArgTypes>
335 SDNodeT *newSDNode(ArgTypes &&...
Args) {
336 return new (NodeAllocator.template Allocate<SDNodeT>())
337 SDNodeT(std::forward<ArgTypes>(
Args)...);
346 template <
typename SDNodeT,
typename... ArgTypes>
347 static uint16_t getSyntheticNodeSubclassData(
unsigned IROrder,
348 ArgTypes &&...
Args) {
352 return SDNodeT(IROrder,
DebugLoc(), std::forward<ArgTypes>(
Args)...)
353 .getRawSubclassData();
356 template <
typename SDNodeTy>
357 static uint16_t getSyntheticNodeSubclassData(
unsigned Opc,
unsigned Order,
360 return SDNodeTy(Opc, Order,
DebugLoc(), VTs, MemoryVT, MMO)
361 .getRawSubclassData();
367 if (!Node->OperandList)
372 Node->NumOperands = 0;
373 Node->OperandList =
nullptr;
375 void CreateTopologicalOrder(std::vector<SDNode*>& Order);
408 void viewGraph(
const std::string &Title);
417 void clearGraphAttrs();
420 void setGraphAttrs(
const SDNode *
N,
const char *
Attrs);
424 const std::string getGraphAttrs(
const SDNode *
N)
const;
427 void setGraphColor(
const SDNode *
N,
const char *
Color);
430 void setSubgraphColor(SDNode *
N,
const char *
Color);
443 return AllNodes.size();
447 return make_range(allnodes_begin(), allnodes_end());
450 return make_range(allnodes_begin(), allnodes_end());
458 return SDValue(const_cast<SDNode *>(&EntryNode), 0);
465 "DAG root value is not a chain!");
474 void VerifyDAGDiverence();
489 bool LegalizeTypes();
531 bool LegalizeVectors();
534 void RemoveDeadNodes();
538 void DeleteNode(SDNode *N);
557 bool isTarget =
false,
bool isOpaque =
false);
559 bool isTarget =
false,
bool isOpaque =
false);
562 bool IsOpaque =
false) {
564 VT, IsTarget, IsOpaque);
568 bool isTarget =
false,
bool isOpaque =
false);
569 SDValue getIntPtrConstant(uint64_t Val,
const SDLoc &DL,
570 bool isTarget =
false);
572 bool isOpaque =
false) {
576 bool isOpaque =
false) {
580 bool isOpaque =
false) {
598 bool isTarget =
false);
600 bool isTarget =
false);
602 bool isTarget =
false);
604 return getConstantFP(Val, DL, VT,
true);
607 return getConstantFP(Val, DL, VT,
true);
610 return getConstantFP(Val, DL, VT,
true);
615 int64_t offset = 0,
bool isTargetGA =
false,
620 return getGlobalAddress(GV, DL, VT, offset,
true,
TargetFlags);
622 SDValue getFrameIndex(
int FI,
EVT VT,
bool isTarget =
false);
624 return getFrameIndex(FI, VT,
true);
626 SDValue getJumpTable(
int JTI,
EVT VT,
bool isTarget =
false,
632 unsigned Align = 0,
int Offs = 0,
bool isT=
false,
640 unsigned Align = 0,
int Offs = 0,
bool isT=
false,
653 SDValue getExternalSymbol(
const char *Sym,
EVT VT);
655 SDValue getTargetExternalSymbol(
const char *Sym,
EVT VT,
666 int64_t
Offset = 0,
bool isTarget =
false,
702 SDValue Ops[] = { Chain, getRegister(Reg, VT) };
712 SDValue Ops[] = { Chain, getRegister(Reg, VT), Glue };
752 "A splatted value must have a width equal or (for integers) " 753 "greater than the vector element type!");
821 return getObjectPtrOffset(SL, Op,
getConstant(Offset, SL, VT));
831 return getNode(
ISD::ADD, SL, VT, Op, Offset, Flags);
841 getIntPtrConstant(InSize, DL,
true),
842 getIntPtrConstant(OutSize, DL,
true) };
923 SDValue Size,
unsigned Align,
bool isVol,
bool isTailCall,
928 SDValue Size,
unsigned Align,
bool isVol,
bool isTailCall,
932 unsigned DstAlign,
SDValue Src,
unsigned SrcAlign,
938 unsigned DstAlign,
SDValue Src,
unsigned SrcAlign,
945 Type *SizeTy,
unsigned ElemSz,
bool isTailCall,
954 "Cannot compare scalars to vectors");
956 "Cannot compare scalars to vectors");
958 "Cannot create a setCC of an invalid node.");
959 return getNode(
ISD::SETCC, DL, VT, LHS, RHS, getCondCode(Cond));
967 "Cannot use select on differing types");
969 "Cannot mix vectors and scalars");
980 LHS, RHS, True, False, getCondCode(Cond));
1051 const MDNode *Ranges =
nullptr);
1057 unsigned Alignment = 0,
1070 const MDNode *Ranges =
nullptr);
1102 bool IsExpanding =
false);
1106 bool IsCompressing =
false);
1114 template <
class TargetMemSDNode>
1120 SDValue getSrcValue(
const Value *v);
1138 SDValue expandVAArg(SDNode *Node);
1141 SDValue expandVACopy(SDNode *Node);
1149 SDNode *UpdateNodeOperands(SDNode *N,
SDValue Op);
1160 void updateDivergence(SDNode * N);
1166 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT);
1167 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
SDValue Op1);
1168 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
1170 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
1172 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
1174 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
EVT VT2);
1175 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
1177 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
1179 SDNode *SelectNodeTo(SDNode *N,
unsigned TargetOpc,
EVT VT1,
1181 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
1183 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
SDVTList VTs,
1188 SDNode *MorphNodeTo(SDNode *N,
unsigned Opc,
SDVTList VTs,
1194 SDNode *mutateStrictFPToFP(SDNode *Node);
1243 unsigned R,
bool IsIndirect,
const DebugLoc &DL,
1248 const Value *C,
const DebugLoc &DL,
1253 unsigned FI,
bool IsIndirect,
1258 unsigned VReg,
bool IsIndirect,
1267 void transferDbgValues(
SDValue From,
SDValue To,
unsigned OffsetInBits = 0,
1268 unsigned SizeInBits = 0,
bool InvalidateDbg =
true);
1273 void RemoveDeadNode(SDNode *N);
1295 void ReplaceAllUsesWith(SDNode *From, SDNode *To);
1296 void ReplaceAllUsesWith(SDNode *From,
const SDValue *To);
1305 void ReplaceAllUsesOfValuesWith(
const SDValue *From,
const SDValue *To,
1318 unsigned AssignTopologicalOrder();
1343 void AddDbgValue(
SDDbgValue *DB, SDNode *SD,
bool isParameter);
1384 SDValue CreateStackTemporary(
EVT VT,
unsigned minAlign = 1);
1390 SDValue FoldSymbolOffset(
unsigned Opcode,
EVT VT,
1394 SDValue FoldConstantArithmetic(
unsigned Opcode,
const SDLoc &DL,
EVT VT,
1395 SDNode *Cst1, SDNode *Cst2);
1397 SDValue FoldConstantArithmetic(
unsigned Opcode,
const SDLoc &DL,
EVT VT,
1401 SDValue FoldConstantVectorArithmetic(
unsigned Opcode,
const SDLoc &DL,
EVT VT,
1419 bool SignBitIsZero(
SDValue Op,
unsigned Depth = 0)
const;
1440 unsigned Depth = 0)
const;
1478 unsigned Depth = 0)
const;
1485 bool isBaseWithConstantOffset(
SDValue Op)
const;
1492 bool isKnownNeverZeroFloat(
SDValue Op)
const;
1495 bool isKnownNeverZero(
SDValue Op)
const;
1512 SDValue UnrollVectorOp(SDNode *N,
unsigned ResNE = 0);
1519 unsigned Bytes,
int Dist)
const;
1523 unsigned InferPtrAlignment(
SDValue Ptr)
const;
1527 std::pair<EVT, EVT> GetSplitDestVTs(
const EVT &VT)
const;
1531 std::pair<SDValue, SDValue> SplitVector(
const SDValue &N,
const SDLoc &DL,
1532 const EVT &LoVT,
const EVT &HiVT);
1537 std::tie(LoVT, HiVT) = GetSplitDestVTs(N.
getValueType());
1538 return SplitVector(N, DL, LoVT, HiVT);
1551 unsigned Start = 0,
unsigned Count = 0);
1554 unsigned getEVTAlignment(
EVT MemoryVT)
const;
1557 SDNode *isConstantIntBuildVectorOrConstantInt(
SDValue N);
1565 return isConstantIntBuildVectorOrConstantInt(N) ||
1570 void InsertNode(SDNode *N);
1571 bool RemoveNodeFromCSEMaps(SDNode *N);
1572 void AddModifiedNodeToCSEMaps(SDNode *N);
1573 SDNode *FindModifiedNodeSlot(SDNode *N,
SDValue Op,
void *&InsertPos);
1574 SDNode *FindModifiedNodeSlot(SDNode *N,
SDValue Op1,
SDValue Op2,
1578 SDNode *UpdateSDLocOnMergeSDNode(SDNode *N,
const SDLoc &loc);
1580 void DeleteNodeNotInCSEMaps(SDNode *N);
1581 void DeallocateNode(SDNode *N);
1583 void allnodes_clear();
1601 std::vector<CondCodeSDNode*> CondCodeNodes;
1603 std::vector<SDNode*> ValueTypeNodes;
1604 std::map<EVT, SDNode*, EVT::compareRawBits> ExtendedValueTypeNodes;
1607 std::map<std::pair<std::string, unsigned char>,SDNode*> TargetExternalSymbols;
1623 template <
class TargetMemSDNode>
1634 for (
auto&
Op : Ops) {
1640 ID.
AddInteger(getSyntheticNodeSubclassData<TargetMemSDNode>(
1644 if (SDNode *
E = FindNodeOrInsertPos(ID, dl, IP)) {
1645 cast<TargetMemSDNode>(
E)->refineAlignment(MMO);
1652 createOperands(
N, Ops);
1660 #endif // LLVM_CODEGEN_SELECTIONDAG_H Pass interface - Implemented by all 'passes'.
static const fltSemantics & IEEEquad() LLVM_READNONE
void AddPointer(const void *Ptr)
Add* - Add various data types to Bit data.
void push_back(const T &Elt)
A parsed version of the target data layout string in and methods for querying it. ...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
EVT getValueType() const
Return the ValueType of the referenced return value.
bool isKnownToBeAPowerOfTwo(const Value *V, const DataLayout &DL, bool OrZero=false, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
Return true if the given value is known to have exactly one bit set when defined. ...
OverflowKind
Used to represent the possible overflow behavior of an operation.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT, SDValue Glue)
static APInt getAllOnesValue(unsigned numBits)
Get the all-ones value.
const TargetLibraryInfo & getLibInfo() const
Keeps track of dbg_value information through SDISel.
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2, SDValue InGlue, const SDLoc &DL)
Return a new CALLSEQ_END node, which always must have a glue result (to ensure it's not CSE'd)...
Atomic ordering constants.
Compute iterated dominance frontiers using a linear time algorithm.
static void removeOperands(MachineInstr &MI, unsigned i)
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
DbgIterator ByvalParmDbgEnd()
Implements a dense probed hash-table based set.
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
Clients of various APIs that cause global effects on the DAG can optionally implement this interface...
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
static bool Equals(const SDVTListNode &X, const FoldingSetNodeID &ID, unsigned IDHash, FoldingSetNodeID &TempID)
bool salvageDebugInfo(Instruction &I)
Assuming the instruction I is going to be deleted, attempt to salvage debug users of I by writing the...
static const fltSemantics & EVTToAPFloatSemantics(EVT VT)
Returns an APFloat semantics tag appropriate for the given type.
Recycle small arrays allocated from a BumpPtrAllocator.
SDValue getTargetConstantFP(const ConstantFP &Val, const SDLoc &DL, EVT VT)
bool isInteger() const
Return true if this is an integer or a vector integer type.
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS)
Helper function to make it easier to build Select's if you just have operands and don't want to check...
SDNode * getNode() const
get the SDNode which holds the desired result
const SDValue & setRoot(SDValue N)
Set the current root tag of the SelectionDAG.
SmallVectorImpl< SDDbgLabel * >::iterator DbgLabelIterator
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
unsigned getAddrSpace() const
Return the LLVM IR address space number that this pointer points into.
SDDbgInfo::DbgIterator DbgBegin()
The address of a basic block.
A description of a memory reference used in the backend.
SDValue getTargetConstantFP(const APFloat &Val, const SDLoc &DL, EVT VT)
void Reset()
Deallocate all but the current slab and reset the current pointer to the beginning of it...
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
CopyToReg - This node has three operands: a chain, a register number to set to this value...
SDDbgInfo::DbgLabelIterator DbgLabelBegin()
CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end of a call sequence, and carry arbitrary information that target might want to know.
void AddInteger(signed I)
SmallVectorImpl< SDDbgValue * >::iterator DbgIterator
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
const DataLayout & getDataLayout() const
void setFunctionLoweringInfo(FunctionLoweringInfo *FuncInfo)
SDValue getTargetConstant(const ConstantInt &Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
Position
Position to insert a new instruction relative to an existing instruction.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
This file implements a class to represent arbitrary precision integral constant values and operations...
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
iterator_range< allnodes_iterator > allnodes()
AtomicOrdering
Atomic ordering for LLVM's memory model.
static int64_t getConstant(const MachineInstr *MI)
void InsertNode(T *N, void *InsertPos)
InsertNode - Insert the specified node into the folding set, knowing that it is not already in the fo...
unsigned getScalarSizeInBits() const
void checkForCycles(const SelectionDAG *DAG, bool force=false)
MachineFunction & getMachineFunction() const
DAGUpdateListener *const Next
SDValue getTargetFrameIndex(int FI, EVT VT)
const TargetMachine & getTarget() const
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
Simple integer binary arithmetic operators.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
bool haveNoCommonBitsSet(const Value *LHS, const Value *RHS, const DataLayout &DL, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
Return true if LHS and RHS have no common bits set.
static const fltSemantics & IEEEdouble() LLVM_READNONE
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
allnodes_iterator allnodes_end()
SDValue getSplatBuildVector(EVT VT, const SDLoc &DL, SDValue Op)
Return a splat ISD::BUILD_VECTOR node, consisting of Op splatted to all elements. ...
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
allnodes_iterator allnodes_begin()
SDValue getTargetConstantFP(double Val, const SDLoc &DL, EVT VT)
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDUse > Ops)
Return an ISD::BUILD_VECTOR node.
UNDEF - An undefined node.
virtual ~DAGUpdateListener()
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
iterator find(const_arg_type_t< KeyT > Val)
SDDbgInfo::DbgIterator ByvalParmDbgEnd()
unsigned ComputeHash() const
ComputeHash - Compute a strong hash value for this FoldingSetNodeIDRef, used to lookup the node in th...
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Use delete by default for iplist and ilist.
DAGNodeDeletedListener(SelectionDAG &DAG, std::function< void(SDNode *, SDNode *)> Callback)
initializer< Ty > init(const Ty &Val)
FoldingSetTrait - This trait class is used to define behavior of how to "profile" (in the FoldingSet ...
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
static nodes_iterator nodes_begin(SelectionDAG *G)
The instances of the Type class are immutable: once they are created, they are never changed...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const SelectionDAGTargetInfo & getSelectionDAGInfo() const
This is an important class for using LLVM in a threaded context.
Allocate memory in an ever growing pool, as if by bump-pointer.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
bool hasDebugValues() const
Return true if there are any SDDbgValue nodes associated with this SelectionDAG.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
const SDValue & getOperand(unsigned Num) const
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
bool MaskedValueIsZero(const Value *V, const APInt &Mask, const DataLayout &DL, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
Return true if 'V & Mask' is known to be zero.
DbgLabelIterator DbgLabelEnd()
ConstantFP - Floating Point Values [float, double].
SDValue getCALLSEQ_START(SDValue Chain, uint64_t InSize, uint64_t OutSize, const SDLoc &DL)
Return a new CALLSEQ_START node, that starts new call frame, in which InSize bytes are set up inside ...
DAGUpdateListener(SelectionDAG &D)
std::pair< SDValue, SDValue > SplitVectorOperand(const SDNode *N, unsigned OpNo)
Split the node's operand with EXTRACT_SUBVECTOR and return the low/high part.
This file declares a class to represent arbitrary precision floating point values and provide a varie...
BumpPtrAllocator & getAlloc()
ArrayRef< SDDbgValue * > GetDbgValues(const SDNode *SD)
Get the debug values which reference the given SDNode.
void RepositionNode(allnodes_iterator Position, SDNode *N)
Move node N in the AllNodes list to be immediately before the given iterator Position.
Base class for variables.
static const fltSemantics & x87DoubleExtended() LLVM_READNONE
std::pair< SDValue, SDValue > SplitVector(const SDValue &N, const SDLoc &DL)
Split the vector with EXTRACT_SUBVECTOR and return the low/high part.
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
const Pass * getPass() const
ArrayRef< SDDbgValue * > getSDDbgValues(const SDNode *Node)
Abstract base class for all machine specific constantpool value subclasses.
SDValue getTargetConstantPool(MachineConstantPoolValue *C, EVT VT, unsigned Align=0, int Offset=0, unsigned char TargetFlags=0)
SDValue getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget=false, bool IsOpaque=false)
iterator_range< allnodes_const_iterator > allnodes() const
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N, SDValue Glue)
An intrusive list with ownership and callbacks specified/controlled by ilist_traits, only with API safe for polymorphic types.
This class contains a discriminated union of information about pointers in memory operands...
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool isKnownNeverNaN(const Value *V)
Return true if the floating-point scalar value is not a NaN or if the floating-point vector value has...
The memory access writes data.
SDValue getObjectPtrOffset(const SDLoc &SL, SDValue Op, SDValue Offset)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
SDValue getTargetConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offset=0, unsigned char TargetFlags=0)
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned char TargetFlags=0)
static bool isUndef(ArrayRef< int > Mask)
static const fltSemantics & IEEEsingle() LLVM_READNONE
const TargetLowering & getTargetLoweringInfo() const
A SetVector that performs no allocations if smaller than a certain size.
Iterator for intrusive lists based on ilist_node.
void setNoUnsignedWrap(bool b)
This is the shared class of boolean and integer constants.
Color
A "color", which is either even or odd.
static const fltSemantics & IEEEhalf() LLVM_READNONE
unsigned ComputeNumSignBits(const Value *Op, const DataLayout &DL, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr)
Return the number of times the sign bit of the register is replicated into the other bits...
ilist< SDNode >::size_type allnodes_size() const
EVT getVectorElementType() const
Given a vector type, return the type of each element.
static nodes_iterator nodes_end(SelectionDAG *G)
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
SDValue getTargetMemSDNode(SDVTList VTs, ArrayRef< SDValue > Ops, const SDLoc &dl, EVT MemVT, MachineMemOperand *MMO)
Return (create a new or find existing) a target-specific node.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
Provides information about what library functions are available for the current target.
const DebugLoc & getDebugLoc() const
SDDbgInfo::DbgIterator DbgEnd()
An SDNode that represents everything that will be needed to construct a MachineInstr.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
Represents one node in the SelectionDAG.
allnodes_const_iterator allnodes_begin() const
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
SDDbgInfo::DbgIterator ByvalParmDbgBegin()
A range adaptor for a pair of iterators.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Class for arbitrary precision integers.
std::function< void(SDNode *, SDNode *)> Callback
Select(COND, TRUEVAL, FALSEVAL).
typename SuperClass::iterator iterator
static void clear(coro::Shape &Shape)
SDDbgInfo::DbgLabelIterator DbgLabelEnd()
Flags
Flags values. These may be or'd together.
AlignedCharArrayUnion< AtomicSDNode, TargetIndexSDNode, BlockAddressSDNode, GlobalAddressSDNode > LargestSDNode
A representation of the largest SDNode, for use in sizeof().
The memory access reads data.
TargetSubtargetInfo - Generic base class for all target subtargets.
bool isConstantValueOfAnyType(SDValue N)
SDValue getTargetConstant(const APInt &Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
std::map< const SDNode *, std::string > NodeGraphAttrs
static const fltSemantics & PPCDoubleDouble() LLVM_READNONE
pointer remove(iterator &IT)
These are IR-level optimization flags that may be propagated to SDNodes.
allnodes_const_iterator allnodes_end() const
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned char TargetFlags=0)
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
SDVTListNode(const FoldingSetNodeIDRef ID, const EVT *VT, unsigned int Num)
const MachinePointerInfo & getPointerInfo() const
iterator insert(iterator where, pointer New)
bool isVector() const
Return true if this is a vector value type.
FoldingSetNodeIDRef - This class describes a reference to an interned FoldingSetNodeID, which can be a useful to store node id data rather than using plain FoldingSetNodeIDs, since the 32-element SmallVector is often much larger than necessary, and the possibility of heap allocation means it requires a non-trivial destructor call.
Holds the information from a dbg_label node through SDISel.
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
Node - This class is used to maintain the singly linked bucket list in a folding set.
LLVM_NODISCARD bool empty() const
static unsigned ComputeHash(const SDVTListNode &X, FoldingSetNodeID &TempID)
const TargetSubtargetInfo & getSubtarget() const
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
unsigned getOpcode() const
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, SDValue Reg, SDValue N, SDValue Glue)
CopyFromReg - This node indicates that the input value is a virtual or physical register that is defi...
const SDValue & getRoot() const
Return the root tag of the SelectionDAG.
SDValue getGLOBAL_OFFSET_TABLE(EVT VT)
Return a GLOBAL_OFFSET_TABLE node. This does not have a useful SDLoc.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
SDValue getSelectCC(const SDLoc &DL, SDValue LHS, SDValue RHS, SDValue True, SDValue False, ISD::CondCode Cond)
Helper function to make it easier to build SelectCC's if you just have an ISD::CondCode instead of an...
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.
DefaultFoldingSetTrait - This class provides default implementations for FoldingSetTrait implementati...
OptimizationRemarkEmitter & getORE() const
static void deleteNode(SDNode *)
Primary interface to the complete machine description for the target machine.
void add(SDDbgValue *V, const SDNode *Node, bool isParameter)
void deallocate(Capacity Cap, T *Ptr)
Deallocate an array with the specified Capacity.
print Print MemDeps of function
SetCC operator - This evaluates to a true value iff the condition is true.
static SDNode * isConstantFPBuildVectorOrConstantFP(SDValue N)
DbgIterator ByvalParmDbgBegin()
SDValue getObjectPtrOffset(const SDLoc &SL, SDValue Op, int64_t Offset)
Create an add instruction with appropriate flags when used for addressing some offset of an object...
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
Holds the information from a dbg_value node through SDISel.
static void Profile(const SDVTListNode &X, FoldingSetNodeID &ID)
DbgLabelIterator DbgLabelBegin()
void computeKnownBits(const Value *V, KnownBits &Known, const DataLayout &DL, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr, OptimizationRemarkEmitter *ORE=nullptr)
Determine which bits of V are known to be either zero or one and return them in the KnownZero/KnownOn...
void NodeDeleted(SDNode *N, SDNode *E) override
The node N that was deleted and, if E is not null, an equivalent node E that replaced it...
LLVMContext * getContext() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
unsigned getIROrder() const
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
This class is used to represent ISD::LOAD nodes.