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();
192 auto I = DbgValMap.
find(Node);
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);
313 virtual void anchor();
321 bool NewNodesMustHaveLegalTypes =
false;
333 bool setSubgraphColorHelper(SDNode *
N,
const char *
Color,
335 int level,
bool &printed);
337 template <
typename SDNodeT,
typename... ArgTypes>
338 SDNodeT *newSDNode(ArgTypes &&...
Args) {
339 return new (NodeAllocator.template Allocate<SDNodeT>())
340 SDNodeT(std::forward<ArgTypes>(
Args)...);
349 template <
typename SDNodeT,
typename... ArgTypes>
350 static uint16_t getSyntheticNodeSubclassData(
unsigned IROrder,
351 ArgTypes &&...
Args) {
355 return SDNodeT(IROrder,
DebugLoc(), std::forward<ArgTypes>(
Args)...)
356 .getRawSubclassData();
359 template <
typename SDNodeTy>
360 static uint16_t getSyntheticNodeSubclassData(
unsigned Opc,
unsigned Order,
363 return SDNodeTy(Opc, Order,
DebugLoc(), VTs, MemoryVT, MMO)
364 .getRawSubclassData();
370 if (!Node->OperandList)
375 Node->NumOperands = 0;
376 Node->OperandList =
nullptr;
378 void CreateTopologicalOrder(std::vector<SDNode*>& Order);
411 void viewGraph(
const std::string &Title);
420 void clearGraphAttrs();
423 void setGraphAttrs(
const SDNode *
N,
const char *
Attrs);
427 const std::string getGraphAttrs(
const SDNode *
N)
const;
430 void setGraphColor(
const SDNode *
N,
const char *
Color);
433 void setSubgraphColor(SDNode *
N,
const char *
Color);
446 return AllNodes.size();
450 return make_range(allnodes_begin(), allnodes_end());
453 return make_range(allnodes_begin(), allnodes_end());
461 return SDValue(const_cast<SDNode *>(&EntryNode), 0);
468 "DAG root value is not a chain!");
478 void VerifyDAGDiverence();
494 bool LegalizeTypes();
536 bool LegalizeVectors();
539 void RemoveDeadNodes();
543 void DeleteNode(SDNode *N);
562 bool isTarget =
false,
bool isOpaque =
false);
564 bool isTarget =
false,
bool isOpaque =
false);
567 bool IsOpaque =
false) {
569 VT, IsTarget, IsOpaque);
573 bool isTarget =
false,
bool isOpaque =
false);
574 SDValue getIntPtrConstant(uint64_t Val,
const SDLoc &DL,
575 bool isTarget =
false);
577 bool isOpaque =
false) {
581 bool isOpaque =
false) {
585 bool isOpaque =
false) {
603 bool isTarget =
false);
605 bool isTarget =
false);
607 bool isTarget =
false);
609 return getConstantFP(Val, DL, VT,
true);
612 return getConstantFP(Val, DL, VT,
true);
615 return getConstantFP(Val, DL, VT,
true);
620 int64_t offset = 0,
bool isTargetGA =
false,
625 return getGlobalAddress(GV, DL, VT, offset,
true,
TargetFlags);
627 SDValue getFrameIndex(
int FI,
EVT VT,
bool isTarget =
false);
629 return getFrameIndex(FI, VT,
true);
631 SDValue getJumpTable(
int JTI,
EVT VT,
bool isTarget =
false,
637 unsigned Align = 0,
int Offs = 0,
bool isT=
false,
645 unsigned Align = 0,
int Offs = 0,
bool isT=
false,
658 SDValue getExternalSymbol(
const char *Sym,
EVT VT);
660 SDValue getTargetExternalSymbol(
const char *Sym,
EVT VT,
671 int64_t
Offset = 0,
bool isTarget =
false,
707 SDValue Ops[] = { Chain, getRegister(Reg, VT) };
717 SDValue Ops[] = { Chain, getRegister(Reg, VT), Glue };
757 "A splatted value must have a width equal or (for integers) " 758 "greater than the vector element type!");
808 return getObjectPtrOffset(SL, Op,
getConstant(Offset, SL, VT));
818 return getNode(
ISD::ADD, SL, VT, Op, Offset, Flags);
828 getIntPtrConstant(InSize, DL,
true),
829 getIntPtrConstant(OutSize, DL,
true) };
910 SDValue Size,
unsigned Align,
bool isVol,
bool isTailCall,
915 SDValue Size,
unsigned Align,
bool isVol,
bool isTailCall,
919 unsigned DstAlign,
SDValue Src,
unsigned SrcAlign,
925 unsigned DstAlign,
SDValue Src,
unsigned SrcAlign,
932 Type *SizeTy,
unsigned ElemSz,
bool isTailCall,
940 "Cannot compare scalars to vectors");
942 "Cannot compare scalars to vectors");
944 "Cannot create a setCC of an invalid node.");
953 "Cannot use select on differing types");
955 "Cannot mix vectors and scalars");
957 return getNode(Opcode, DL, VT, Cond, LHS, RHS);
1042 const MDNode *Ranges =
nullptr);
1048 unsigned Alignment = 0,
1061 const MDNode *Ranges =
nullptr);
1093 bool IsExpanding =
false);
1097 bool IsCompressing =
false);
1105 template <
class TargetMemSDNode>
1111 SDValue getSrcValue(
const Value *v);
1129 SDValue expandVAArg(SDNode *Node);
1132 SDValue expandVACopy(SDNode *Node);
1139 Function **TargetFunction =
nullptr);
1147 SDNode *UpdateNodeOperands(SDNode *N,
SDValue Op);
1163 void updateDivergence(SDNode * N);
1169 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT);
1170 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
SDValue Op1);
1171 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
1173 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
1175 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
1177 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
EVT VT2);
1178 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
1180 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
1182 SDNode *SelectNodeTo(SDNode *N,
unsigned TargetOpc,
EVT VT1,
1184 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
1186 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
SDVTList VTs,
1191 SDNode *MorphNodeTo(SDNode *N,
unsigned Opc,
SDVTList VTs,
1197 SDNode *mutateStrictFPToFP(SDNode *Node);
1246 unsigned R,
bool IsIndirect,
const DebugLoc &DL,
1251 const Value *C,
const DebugLoc &DL,
1256 unsigned FI,
bool IsIndirect,
1261 unsigned VReg,
bool IsIndirect,
1271 unsigned SizeInBits = 0,
bool InvalidateDbg =
true);
1276 void RemoveDeadNode(SDNode *N);
1298 void ReplaceAllUsesWith(SDNode *From, SDNode *To);
1299 void ReplaceAllUsesWith(SDNode *From,
const SDValue *To);
1308 void ReplaceAllUsesOfValuesWith(
const SDValue *From,
const SDValue *To,
1321 unsigned AssignTopologicalOrder();
1346 void AddDbgValue(
SDDbgValue *DB, SDNode *SD,
bool isParameter);
1387 SDValue CreateStackTemporary(
EVT VT,
unsigned minAlign = 1);
1393 SDValue FoldSymbolOffset(
unsigned Opcode,
EVT VT,
1397 SDValue FoldConstantArithmetic(
unsigned Opcode,
const SDLoc &DL,
EVT VT,
1398 SDNode *Cst1, SDNode *Cst2);
1400 SDValue FoldConstantArithmetic(
unsigned Opcode,
const SDLoc &DL,
EVT VT,
1404 SDValue FoldConstantVectorArithmetic(
unsigned Opcode,
const SDLoc &DL,
EVT VT,
1422 bool SignBitIsZero(
SDValue Op,
unsigned Depth = 0)
const;
1443 unsigned Depth = 0)
const;
1481 unsigned Depth = 0)
const;
1488 bool isBaseWithConstantOffset(
SDValue Op)
const;
1502 bool isKnownNeverZeroFloat(
SDValue Op)
const;
1505 bool isKnownNeverZero(
SDValue Op)
const;
1526 bool isSplatValue(
SDValue V,
bool AllowUndefs =
false);
1543 SDValue UnrollVectorOp(SDNode *N,
unsigned ResNE = 0);
1550 unsigned Bytes,
int Dist)
const;
1554 unsigned InferPtrAlignment(
SDValue Ptr)
const;
1558 std::pair<EVT, EVT> GetSplitDestVTs(
const EVT &VT)
const;
1562 std::pair<SDValue, SDValue> SplitVector(
const SDValue &N,
const SDLoc &DL,
1563 const EVT &LoVT,
const EVT &HiVT);
1568 std::tie(LoVT, HiVT) = GetSplitDestVTs(N.
getValueType());
1569 return SplitVector(N, DL, LoVT, HiVT);
1582 unsigned Start = 0,
unsigned Count = 0);
1585 unsigned getEVTAlignment(
EVT MemoryVT)
const;
1588 SDNode *isConstantIntBuildVectorOrConstantInt(
SDValue N);
1596 return isConstantIntBuildVectorOrConstantInt(N) ||
1601 void InsertNode(SDNode *N);
1602 bool RemoveNodeFromCSEMaps(SDNode *N);
1603 void AddModifiedNodeToCSEMaps(SDNode *N);
1604 SDNode *FindModifiedNodeSlot(SDNode *N,
SDValue Op,
void *&InsertPos);
1605 SDNode *FindModifiedNodeSlot(SDNode *N,
SDValue Op1,
SDValue Op2,
1609 SDNode *UpdateSDLocOnMergeSDNode(SDNode *N,
const SDLoc &loc);
1611 void DeleteNodeNotInCSEMaps(SDNode *N);
1612 void DeallocateNode(SDNode *N);
1614 void allnodes_clear();
1632 std::vector<CondCodeSDNode*> CondCodeNodes;
1634 std::vector<SDNode*> ValueTypeNodes;
1635 std::map<EVT, SDNode*, EVT::compareRawBits> ExtendedValueTypeNodes;
1638 std::map<std::pair<std::string, unsigned char>,SDNode*> TargetExternalSymbols;
1654 template <
class TargetMemSDNode>
1665 for (
auto&
Op : Ops) {
1671 ID.
AddInteger(getSyntheticNodeSubclassData<TargetMemSDNode>(
1675 if (SDNode *
E = FindNodeOrInsertPos(ID, dl, IP)) {
1676 cast<TargetMemSDNode>(
E)->refineAlignment(MMO);
1683 createOperands(
N, Ops);
1691 #endif // LLVM_CODEGEN_SELECTIONDAG_H Pass interface - Implemented by all 'passes'.
static const fltSemantics & IEEEquad() LLVM_READNONE
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, bool UseInstrInfo=true)
Determine which bits of V are known to be either zero or one and return them in the KnownZero/KnownOn...
void AddPointer(const void *Ptr)
Add* - Add various data types to Bit data.
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.
OverflowKind
Used to represent the possible overflow behavior of an operation.
static MSP430CC::CondCodes getCondCode(unsigned Cond)
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.
This class represents lattice values for constants.
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.
void push_back(const T &Elt)
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.
ArrayRef< SDDbgValue * > getSDDbgValues(const SDNode *Node) const
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) ...
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
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.
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
SDDbgInfo::DbgIterator DbgBegin()
The address of a basic block.
A description of a memory reference used in the backend.
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, bool UseInstrInfo=true)
Return true if the given value is known to have exactly one bit set when defined. ...
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.
static Optional< unsigned > getOpcode(ArrayRef< VPValue *> Values)
Returns the opcode of Values or ~0 if they do not all agree.
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()
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, bool UseInstrInfo=true)
Return true if 'V & Mask' is known to be zero.
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...
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.
unsigned ComputeNumSignBits(const Value *Op, const DataLayout &DL, unsigned Depth=0, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr, bool UseInstrInfo=true)
Return the number of times the sign bit of the register is replicated into the other bits...
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.
DbgLabelIterator DbgLabelEnd()
bool isKnownNeverSNaN(SDValue Op, unsigned Depth=0) const
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()
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
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.
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.
BlockVerifier::State From
static const fltSemantics & IEEEhalf() LLVM_READNONE
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)
bool haveNoCommonBitsSet(const Value *LHS, const Value *RHS, const DataLayout &DL, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr, bool UseInstrInfo=true)
Return true if LHS and RHS have no common bits set.
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
bool isKnownNeverNaN(const Value *V, const TargetLibraryInfo *TLI, unsigned Depth=0)
Return true if the floating-point scalar value is not a NaN or if the floating-point vector value has...
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.
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
ArrayRef< SDDbgValue * > GetDbgValues(const SDNode *SD) const
Get the debug values which reference the given SDNode.
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 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.