15 #ifndef LLVM_CODEGEN_SELECTIONDAG_H
16 #define LLVM_CODEGEN_SELECTIONDAG_H
35 class MachineConstantPoolValue;
36 class MachineFunction;
40 class TargetSelectionDAGInfo;
57 FastID(ID), VTs(VT), NumVTs(Num) {
74 if (X.HashValue != IDHash)
76 return ID == X.FastID;
88 return static_cast<SDNode*
>(&Sentinel);
121 void operator=(
const SDDbgInfo&) =
delete;
128 ByvalParmDbgValues.push_back(V);
129 }
else DbgValues.push_back(V);
131 DbgValMap[Node].push_back(V);
141 ByvalParmDbgValues.clear();
148 return DbgValues.empty() && ByvalParmDbgValues.empty();
153 if (I != DbgValMap.
end())
230 :
Next(D.UpdateListeners),
DAG(D) {
231 DAG.UpdateListeners =
this;
235 assert(
DAG.UpdateListeners ==
this &&
236 "DAGUpdateListeners must be destroyed in LIFO order");
265 bool setSubgraphColorHelper(
SDNode *
N,
const char *
Color,
267 int level,
bool &printed);
292 void viewGraph(
const std::string &Title);
323 return AllNodes.size();
339 return SDValue(const_cast<SDNode *>(&EntryNode), 0);
346 "DAG root value is not a chain!");
430 bool isOpaque =
false);
432 bool isOpaque =
false);
434 bool isTarget =
false,
bool isOpaque =
false);
437 bool isOpaque =
false) {
441 bool isOpaque =
false) {
445 bool isOpaque =
false) {
452 bool isTarget =
false);
454 bool isTarget =
false);
465 int64_t offset = 0,
bool isTargetGA =
false,
466 unsigned char TargetFlags = 0);
469 unsigned char TargetFlags = 0) {
477 unsigned char TargetFlags = 0);
482 unsigned Align = 0,
int Offs = 0,
bool isT=
false,
483 unsigned char TargetFlags = 0);
485 unsigned Align = 0,
int Offset = 0,
486 unsigned char TargetFlags = 0) {
490 unsigned Align = 0,
int Offs = 0,
bool isT=
false,
491 unsigned char TargetFlags = 0);
494 int Offset = 0,
unsigned char TargetFlags=0) {
498 unsigned char TargetFlags = 0);
506 unsigned char TargetFlags = 0);
514 int64_t Offset = 0,
bool isTarget =
false,
515 unsigned char TargetFlags = 0);
518 unsigned char TargetFlags = 0) {
576 const int *MaskElts);
580 "Must have the same number of vector elements as mask elements!");
710 SDValue Size,
unsigned Align,
bool isVol,
bool AlwaysInline,
715 SDValue Size,
unsigned Align,
bool isVol,
bool isTailCall,
720 SDValue Size,
unsigned Align,
bool isVol,
bool isTailCall,
729 "Cannot compare scalars to vectors");
731 "Cannot compare scalars to vectors");
733 "Cannot create a setCC of an invalid node.");
742 "Cannot use select on differing types");
744 "Cannot mix vectors and scalars");
816 unsigned Align = 0,
bool Vol =
false,
817 bool ReadMem =
true,
bool WriteMem =
true,
832 bool isNonTemporal,
bool isInvariant,
unsigned Alignment,
839 EVT MemVT,
bool isVolatile,
840 bool isNonTemporal,
bool isInvariant,
unsigned Alignment,
851 bool isVolatile,
bool isNonTemporal,
bool isInvariant,
862 bool isNonTemporal,
unsigned Alignment,
868 bool isNonTemporal,
bool isVolatile,
898 unsigned SrcAS,
unsigned DestAS);
1066 AllNodes.insert(Position, AllNodes.remove(N));
1092 default:
return false;
1172 unsigned Depth = 0)
const;
1213 unsigned Bytes,
int Dist)
const;
1226 const EVT &LoVT,
const EVT &HiVT);
1245 unsigned Start = 0,
unsigned Count = 0);
1250 void InsertNode(
SDNode *N);
1251 bool RemoveNodeFromCSEMaps(
SDNode *N);
1252 void AddModifiedNodeToCSEMaps(
SDNode *N);
1260 void DeleteNodeNotInCSEMaps(
SDNode *N);
1261 void DeallocateNode(
SDNode *N);
1263 void allnodes_clear();
1285 std::vector<CondCodeSDNode*> CondCodeNodes;
1287 std::vector<SDNode*> ValueTypeNodes;
1288 std::map<EVT, SDNode*, EVT::compareRawBits> ExtendedValueTypeNodes;
1291 std::map<std::pair<std::string, unsigned char>,
SDNode*> TargetExternalSymbols;
bool LegalizeOp(SDNode *N, SmallSetVector< SDNode *, 16 > &UpdatedNodes)
Transforms a SelectionDAG node and any operands to it into a node that is compatible with the target ...
SDValue getTruncStore(SDValue Chain, SDLoc dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT TVT, bool isNonTemporal, bool isVolatile, unsigned Alignment, const AAMDNodes &AAInfo=AAMDNodes())
SDNode * MorphNodeTo(SDNode *N, unsigned Opc, SDVTList VTs, ArrayRef< SDValue > Ops)
This mutates the specified node to have the specified return type, opcode, and operands.
iterator_range< allnodes_const_iterator > allnodes() const
void push_back(const T &Elt)
A parsed version of the target data layout string in and methods for querying it. ...
const std::string getGraphAttrs(const SDNode *N) const
Get graph attributes for a node.
SDValue getTargetConstant(const APInt &Val, SDLoc DL, EVT VT, bool isOpaque=false)
LLVMContext * getContext() const
SDValue getTargetIndex(int Index, EVT VT, int64_t Offset=0, unsigned char TargetFlags=0)
bool LegalizeTypes()
This transforms the SelectionDAG into a SelectionDAG that only uses types natively supported by the t...
Keeps track of dbg_value information through SDISel.
SDValue getCopyToReg(SDValue Chain, SDLoc dl, unsigned Reg, SDValue N)
SDValue UnrollVectorOp(SDNode *N, unsigned ResNE=0)
Utility function used by legalize and lowering to "unroll" a vector operation by splitting out the sc...
SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2, SDValue InGlue, SDLoc DL)
Return a new CALLSEQ_END node, which always must have a glue result (to ensure it's not CSE'd)...
SDValue getIndexedLoad(SDValue OrigLoad, SDLoc dl, SDValue Base, SDValue Offset, ISD::MemIndexedMode AM)
bool isKnownNeverNaN(SDValue Op) const
Test whether the given SDValue is known to never be NaN.
AlignOf - A templated class that contains an enum value representing the alignment of the template ar...
bool hasDebugValues() const
Return true if there are any SDDbgValue nodes associated with this SelectionDAG.
SDValue getBoolExtOrTrunc(SDValue Op, SDLoc SL, EVT VT, EVT OpVT)
Convert Op, which must be of integer type, to the integer type VT, by using an extension appropriate ...
static NodeTy * createNode(const NodeTy &V)
static const fltSemantics IEEEdouble
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
DbgIterator ByvalParmDbgEnd()
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
SDValue getVAArg(EVT VT, SDLoc dl, SDValue Chain, SDValue Ptr, SDValue SV, unsigned Align)
VAArg produces a result and token chain, and takes a pointer and a source value as input...
SDValue getZeroExtendVectorInReg(SDValue Op, SDLoc DL, EVT VT)
Return an operation which will zero extend the low lanes of the operand into the specified vector typ...
DenseSet - This implements a dense probed hash-table based set.
SDValue getMergeValues(ArrayRef< SDValue > Ops, SDLoc dl)
Create a MERGE_VALUES node from the given operands.
Carry-setting nodes for multiple precision addition and subtraction.
const TargetMachine & getTarget() const
Clients of various APIs that cause global effects on the DAG can optionally implement this interface...
const TargetSubtargetInfo & getSubtarget() const
unsigned InferPtrAlignment(SDValue Ptr) const
Infer alignment of a load / store address.
bool LegalizeVectors()
This transforms the SelectionDAG into a SelectionDAG that only uses vector math operations supported ...
void computeKnownBits(SDValue Op, APInt &KnownZero, APInt &KnownOne, unsigned Depth=0) const
Determine which bits of Op are known to be either zero or one and return them in the KnownZero/KnownO...
std::pair< EVT, EVT > GetSplitDestVTs(const EVT &VT) const
Compute the VTs needed for the low/hi parts of a type which is split (or expanded) into two not neces...
SDValue getBasicBlock(MachineBasicBlock *MBB)
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
SDValue getSelectCC(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...
const TargetSelectionDAGInfo & getSelectionDAGInfo() const
static bool Equals(const SDVTListNode &X, const FoldingSetNodeID &ID, unsigned IDHash, FoldingSetNodeID &TempID)
bool NewNodesMustHaveLegalTypes
When true, additional steps are taken to ensure that getConstant() and similar functions return DAG n...
SDValue getLoad(EVT VT, SDLoc dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, bool isVolatile, bool isNonTemporal, bool isInvariant, unsigned Alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
SDValue getZeroExtendInReg(SDValue Op, SDLoc DL, EVT SrcTy)
Return the expression required to zero extend the Op value assuming it was the smaller SrcTy value...
static const fltSemantics & EVTToAPFloatSemantics(EVT VT)
Returns an APFloat semantics tag appropriate for the given type.
void setSubgraphColor(SDNode *N, const char *Color)
Convenience for setting subgraph color attribute.
const SDValue & getOperand(unsigned Num) const
SDValue getMaskedGather(SDVTList VTs, EVT VT, SDLoc dl, ArrayRef< SDValue > Ops, MachineMemOperand *MMO)
static bool isCommutativeBinOp(unsigned Opcode)
Returns true if the opcode is a commutative binary operation.
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned char TargetFlags=0)
ilist< SDNode >::iterator allnodes_iterator
CvtCode
CvtCode enum - This enum defines the various converts CONVERT_RNDSAT supports.
SDValue getCopyFromReg(SDValue Chain, SDLoc dl, unsigned Reg, EVT VT, SDValue Glue)
const SDValue & setRoot(SDValue N)
Set the current root tag of the SelectionDAG.
static void destroySentinel(SDNode *)
void DeleteNode(SDNode *N)
Remove the specified node from the system.
static void noteHead(SDNode *, SDNode *)
SDValue getConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offs=0, bool isT=false, unsigned char TargetFlags=0)
SDValue getCopyToReg(SDValue Chain, SDLoc dl, SDValue Reg, SDValue N, SDValue Glue)
void AddDbgValue(SDDbgValue *DB, SDNode *SD, bool isParameter)
Add a dbg_value SDNode.
iplist< NodeTy >::size_type size_type
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
SDValue getMCSymbol(MCSymbol *Sym, EVT VT)
void ReplaceAllUsesOfValuesWith(const SDValue *From, const SDValue *To, unsigned Num)
Like ReplaceAllUsesOfValueWith, but for multiple values at once.
virtual void NodeUpdated(SDNode *N)
The node N that was updated.
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
SDValue getExternalSymbol(const char *Sym, EVT VT)
SDValue getMemcpy(SDValue Chain, SDLoc dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool AlwaysInline, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
bool isKnownNeverZero(SDValue Op) const
Test whether the given SDValue is known to never be positive or negative Zero.
bool isVector() const
isVector - Return true if this is a vector value type.
SDDbgInfo::DbgIterator DbgBegin()
BlockAddress - The address of a basic block.
void clear()
Clear state and free memory necessary to make this SelectionDAG ready to process a new block...
SDValue getStore(SDValue Chain, SDLoc dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, bool isVolatile, bool isNonTemporal, unsigned Alignment, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
static const fltSemantics x87DoubleExtended
MachineMemOperand - A description of a memory reference used in the backend.
SDValue getMemset(SDValue Chain, SDLoc dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool isTailCall, MachinePointerInfo DstPtrInfo)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void Reset()
Deallocate all but the current slab and reset the current pointer to the beginning of it...
SDValue getTargetConstantFP(const APFloat &Val, SDLoc DL, EVT VT)
unsigned ComputeHash() const
ComputeHash - Compute a strong hash value for this FoldingSetNodeIDRef, used to lookup the node in th...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MachineFunction & getMachineFunction() const
bool isConsecutiveLoad(LoadSDNode *LD, LoadSDNode *Base, unsigned Bytes, int Dist) const
Return true if LD is loading 'Bytes' bytes from a location that is 'Dist' units away from the locatio...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
SDValue getTargetGlobalAddress(const GlobalValue *GV, SDLoc DL, EVT VT, int64_t offset=0, unsigned char TargetFlags=0)
CopyToReg - This node has three operands: a chain, a register number to set to this value...
Reg
All possible values of the reg field in the ModR/M byte.
SDDbgValue * getDbgValue(MDNode *Var, MDNode *Expr, SDNode *N, unsigned R, bool IsIndirect, uint64_t Off, DebugLoc DL, unsigned O)
Creates a SDDbgValue node.
ilist_default_traits - Default template traits for intrusive list.
SDNode * provideInitialHead() const
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.
EVT getScalarType() const
getScalarType - If this is a vector type, return the element type, otherwise return this...
RecyclingAllocator - This class wraps an Allocator, adding the functionality of recycling deleted obj...
allnodes_const_iterator allnodes_end() const
static const fltSemantics IEEEquad
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
SDValue getAnyExtendVectorInReg(SDValue Op, SDLoc DL, EVT VT)
Return an operation which will any-extend the low lanes of the operand into the specified vector type...
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
iterator_range< allnodes_iterator > allnodes()
unsigned getEVTAlignment(EVT MemoryVT) const
getEVTAlignment - Compute the default alignment value for the given type.
unsigned AssignTopologicalOrder()
Topological-sort the AllNodes list and a assign a unique node id for each node in the DAG based on th...
SDValue getCALLSEQ_START(SDValue Chain, SDValue Op, SDLoc DL)
Return a new CALLSEQ_START node, which always must have a glue result (to ensure it's not CSE'd)...
void checkForCycles(const SelectionDAG *DAG, bool force=false)
SDValue getCopyToReg(SDValue Chain, SDLoc dl, unsigned Reg, SDValue N, SDValue Glue)
SDValue getTargetConstantFP(double Val, SDLoc DL, EVT VT)
SDValue getRegisterMask(const uint32_t *RegMask)
DAGUpdateListener *const Next
SDValue getTargetFrameIndex(int FI, EVT VT)
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
Simple integer binary arithmetic operators.
SDValue getVectorShuffle(EVT VT, SDLoc dl, SDValue N1, SDValue N2, const int *MaskElts)
Return an ISD::VECTOR_SHUFFLE node.
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...
allnodes_iterator allnodes_end()
SDValue getAnyExtOrTrunc(SDValue Op, SDLoc DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either any-extending or truncat...
SDValue getTargetConstantFP(const ConstantFP &Val, SDLoc DL, EVT VT)
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
SelectionDAG::allnodes_iterator nodes_iterator
allnodes_iterator allnodes_begin()
void init(MachineFunction &mf)
Prepare this SelectionDAG to process code in the given MachineFunction.
size_t size() const
size - Get the array size.
const DataLayout & getDataLayout() const
UNDEF - An undefined node.
SDValue getAddrSpaceCast(SDLoc dl, EVT VT, SDValue Ptr, unsigned SrcAS, unsigned DestAS)
Return an AddrSpaceCastSDNode.
virtual ~DAGUpdateListener()
TargetSelectionDAGInfo - Targets can subclass this to parameterize the SelectionDAG lowering and inst...
SDDbgInfo::DbgIterator ByvalParmDbgEnd()
SDNode * getNode() const
get the SDNode which holds the desired result
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 paramaters.
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
void setGraphColor(const SDNode *N, const char *Color)
Convenience for setting node color attribute.
SDValue getMDNode(const MDNode *MD)
Return an MDNodeSDNode which holds an MDNode.
SDValue getMaskedScatter(SDVTList VTs, EVT VT, SDLoc dl, ArrayRef< SDValue > Ops, MachineMemOperand *MMO)
FoldingSetTrait - This trait class is used to define behavior of how to "profile" (in the FoldingSet ...
SDValue getCommutedVectorShuffle(const ShuffleVectorSDNode &SV)
Returns an ISD::VECTOR_SHUFFLE node semantically equivalent to the shuffle node in input but with swa...
static nodes_iterator nodes_begin(SelectionDAG *G)
void Legalize()
This transforms the SelectionDAG into a SelectionDAG that is compatible with the target instruction s...
This is an important class for using LLVM in a threaded context.
Allocate memory in an ever growing pool, as if by bump-pointer.
Simple binary floating point operators.
void Combine(CombineLevel Level, AliasAnalysis &AA, CodeGenOpt::Level OptLevel)
This iterates over the nodes in the SelectionDAG, folding certain types of nodes together, or eliminating superfluous nodes.
This is an important base class in LLVM.
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
Carry-using nodes for multiple precision addition and subtraction.
ConstantFP - Floating Point Values [float, double].
DAGUpdateListener(SelectionDAG &D)
void clearGraphAttrs()
Clear all previously defined node graph attributes.
std::pair< SDValue, SDValue > SplitVectorOperand(const SDNode *N, unsigned OpNo)
Split the node's operand with EXTRACT_SUBVECTOR and return the low/high part.
void RemoveDeadNodes()
This method deletes all unreachable nodes in the SelectionDAG.
This class is used for two-operand SDNodes.
SDValue getCopyFromReg(SDValue Chain, SDLoc dl, unsigned Reg, EVT VT)
SDValue getSExtOrTrunc(SDValue Op, SDLoc DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either sign-extending or trunca...
BumpPtrAllocator & getAlloc()
static void deleteNode(SDNode *)
ArrayRef< SDDbgValue * > GetDbgValues(const SDNode *SD)
Get the debug values which reference the given SDNode.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
SDValue getTargetConstant(uint64_t Val, SDLoc DL, EVT VT, bool isOpaque=false)
void RepositionNode(allnodes_iterator Position, SDNode *N)
Move node N in the AllNodes list to be immediately before the given iterator Position.
void RemoveDeadNode(SDNode *N)
Remove the specified node from the system.
std::pair< SDValue, SDValue > SplitVector(const SDValue &N, const SDLoc &DL)
Split the vector with EXTRACT_SUBVECTOR and return the low/high part.
ilist< SDNode >::size_type allnodes_size() const
SDValue getExtLoad(ISD::LoadExtType ExtType, SDLoc dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, bool isVolatile, bool isNonTemporal, bool isInvariant, unsigned Alignment, const AAMDNodes &AAInfo=AAMDNodes())
bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth=0) const
Return true if 'Op & Mask' is known to be zero.
ArrayRef< SDDbgValue * > getSDDbgValues(const SDNode *Node)
EVT - Extended Value Type.
SDValue getGlobalAddress(const GlobalValue *GV, SDLoc DL, EVT VT, int64_t offset=0, bool isTargetGA=false, unsigned char TargetFlags=0)
SDValue getMaskedLoad(EVT VT, SDLoc dl, SDValue Chain, SDValue Ptr, SDValue Mask, SDValue Src0, EVT MemVT, MachineMemOperand *MMO, ISD::LoadExtType)
bool isEqualTo(SDValue A, SDValue B) const
Test whether two SDValues are known to compare equal.
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)
MachinePointerInfo - This class contains a discriminated union of information about pointers in memor...
static const fltSemantics IEEEhalf
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
const SDValue & getRoot() const
Return the root tag of the SelectionDAG.
SDValue getMaskedStore(SDValue Chain, SDLoc dl, SDValue Val, SDValue Ptr, SDValue Mask, EVT MemVT, MachineMemOperand *MMO, bool IsTrunc)
SDValue CreateStackTemporary(EVT VT, unsigned minAlign=1)
Create a stack temporary, suitable for holding the specified value type.
SDValue getBitcast(EVT VT, SDValue V)
Return a bitcast using the SDLoc of the value operand, and casting to the provided type...
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)
SDValue getConvertRndSat(EVT VT, SDLoc dl, SDValue Val, SDValue DTy, SDValue STy, SDValue Rnd, SDValue Sat, ISD::CvtCode Code)
Returns the ConvertRndSat Note: Avoid using this node because it may disappear in the future and most...
SDValue FoldConstantArithmetic(unsigned Opcode, SDLoc DL, EVT VT, SDNode *Cst1, SDNode *Cst2)
SDDbgValue * getConstantDbgValue(MDNode *Var, MDNode *Expr, const Value *C, uint64_t Off, DebugLoc DL, unsigned O)
Constant.
A SetVector that performs no allocations if smaller than a certain size.
SDValue getNOT(SDLoc DL, SDValue Val, EVT VT)
Create a bitwise NOT operation as (XOR Val, -1).
static const fltSemantics PPCDoubleDouble
SDNode * createSentinel() const
This is the shared class of boolean and integer constants.
Color
A "color", which is either even or odd.
allnodes_const_iterator allnodes_begin() const
virtual void NodeDeleted(SDNode *N, SDNode *E)
The node N that was deleted and, if E is not null, an equivalent node E that replaced it...
bool isBaseWithConstantOffset(SDValue Op) const
Return true if the specified operand is an ISD::ADD with a ConstantSDNode on the right-hand side...
std::pair< SDValue, SDValue > SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT, const EVT &HiVT)
Split the vector with EXTRACT_SUBVECTOR using the provides VTs and return the low/high part...
SDNode * UpdateNodeOperands(SDNode *N, SDValue Op)
Mutate the specified node in-place to have the specified operands.
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 getTargetInsertSubreg(int SRIdx, SDLoc DL, EVT VT, SDValue Operand, SDValue Subreg)
A convenience function for creating TargetInstrInfo::INSERT_SUBREG nodes.
SDNode * SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT)
These are used for target selectors to mutate the specified node to have the specified return type...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
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...
SDValue getAtomic(unsigned Opcode, SDLoc dl, EVT MemVT, SDValue Chain, SDValue Ptr, SDValue Val, const Value *PtrVal, unsigned Alignment, AtomicOrdering Ordering, SynchronizationScope SynchScope)
Gets a node for an atomic op, produces result (if relevant) and chain and takes 2 operands...
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
void ExtractVectorElements(SDValue Op, SmallVectorImpl< SDValue > &Args, unsigned Start=0, unsigned Count=0)
Append the extracted elements from Start to Count out of the vector Op in Args.
SmallVectorImpl< SDDbgValue * >::iterator DbgIterator
Represents one node in the SelectionDAG.
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
Node - This class is used to maintain the singly linked bucket list in a folding set.
SDDbgInfo::DbgIterator ByvalParmDbgBegin()
SDValue getVectorShuffle(EVT VT, SDLoc dl, SDValue N1, SDValue N2, ArrayRef< int > MaskElts)
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.
Select(COND, TRUEVAL, FALSEVAL).
SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
SDValue getShiftAmountOperand(EVT LHSTy, SDValue Op)
Return the specified value casted to the target's desired shift amount type.
SDValue getBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, bool isTarget=false, unsigned char TargetFlags=0)
SDDbgValue * getFrameIndexDbgValue(MDNode *Var, MDNode *Expr, unsigned FI, uint64_t Off, DebugLoc DL, unsigned O)
FrameIndex.
TargetSubtargetInfo - Generic base class for all target subtargets.
std::map< const SDNode *, std::string > NodeGraphAttrs
SDValue getStackArgumentTokenFactor(SDValue Chain)
Compute a TokenFactor to force all the incoming stack arguments to be loaded from the stack...
These are IR-level optimization flags that may be propagated to SDNodes.
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned char TargetFlags=0)
static const fltSemantics IEEEsingle
SDVTListNode(const FoldingSetNodeIDRef ID, const EVT *VT, unsigned int Num)
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.
Bitwise operators - logical and, logical or, logical xor.
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
static unsigned ComputeHash(const SDVTListNode &X, FoldingSetNodeID &TempID)
void ReplaceAllUsesWith(SDValue From, SDValue Op)
Modify anything using 'From' to use 'To' instead.
SDValue getIndexedStore(SDValue OrigStoe, SDLoc dl, SDValue Base, SDValue Offset, ISD::MemIndexedMode AM)
iterator find(const KeyT &Val)
SDValue getLogicalNOT(SDLoc DL, SDValue Val, EVT VT)
Create a logical NOT operation as (XOR Val, BooleanOne).
MachineSDNode * getMachineNode(unsigned Opcode, SDLoc dl, EVT VT)
These are used for target selectors to create a new node with specified return type(s), MachineInstr opcode, and operands.
SDValue FoldSetCC(EVT VT, SDValue N1, SDValue N2, ISD::CondCode Cond, SDLoc dl)
Constant fold a setcc to true or false.
CopyFromReg - This node indicates that the input value is a virtual or physical register that is defi...
SDValue getMemmove(SDValue Chain, SDLoc dl, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, bool isVol, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
EVT getValueType() const
Return the ValueType of the referenced return value.
SDValue getCondCode(ISD::CondCode Cond)
SDValue getConstant(uint64_t Val, SDLoc DL, EVT VT, bool isTarget=false, bool isOpaque=false)
SDValue getGLOBAL_OFFSET_TABLE(EVT VT)
Return a GLOBAL_OFFSET_TABLE node. This does not have a useful SDLoc.
static NodeTy * createSentinel()
createSentinel - create the dynamic sentinel
SDValue getSelect(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...
void setGraphAttrs(const SDNode *N, const char *Attrs)
Set graph attributes for a node. (eg. "color=red".)
SDNode * getNodeIfExists(unsigned Opcode, SDVTList VTs, ArrayRef< SDValue > Ops, const SDNodeFlags *Flags=nullptr)
Get the specified node if it's already available, or else return NULL.
SDValue getJumpTable(int JTI, EVT VT, bool isTarget=false, unsigned char TargetFlags=0)
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
SDValue getTargetExtractSubreg(int SRIdx, SDLoc DL, EVT VT, SDValue Operand)
A convenience function for creating TargetInstrInfo::EXTRACT_SUBREG nodes.
SDValue getZExtOrTrunc(SDValue Op, SDLoc DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either zero-extending or trunca...
LLVM Value Representation.
SDValue getRegister(unsigned Reg, EVT VT)
SDValue getEHLabel(SDLoc dl, SDValue Root, MCSymbol *Label)
SDValue getValueType(EVT)
DefaultFoldingSetTrait - This class provides default implementations for FoldingSetTrait implementati...
unsigned ComputeNumSignBits(SDValue Op, unsigned Depth=0) const
Return the number of times the sign bit of the register is replicated into the other bits...
const TargetLowering & getTargetLoweringInfo() const
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.Val alone...
Primary interface to the complete machine description for the target machine.
void add(SDDbgValue *V, const SDNode *Node, bool isParameter)
SDValue getSignExtendVectorInReg(SDValue Op, SDLoc DL, EVT VT)
Return an operation which will sign extend the low lanes of the operand into the specified vector typ...
SDValue getSrcValue(const Value *v)
Construct a node to track a Value* through the backend.
SetCC operator - This evaluates to a true value iff the condition is true.
SDValue getTargetConstant(const ConstantInt &Val, SDLoc DL, EVT VT, bool isOpaque=false)
SDValue getConstantFP(double Val, SDLoc DL, EVT VT, bool isTarget=false)
SDValue getSetCC(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...
SDNode * ensureHead(SDNode *) const
MaskedGatherScatterSDNode LargestSDNode
The largest SDNode class.
static bool isVolatile(Instruction *Inst)
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
ilist< SDNode >::const_iterator allnodes_const_iterator
bool SignBitIsZero(SDValue Op, unsigned Depth=0) const
Return true if the sign bit of Op is known to be zero.
DbgIterator ByvalParmDbgBegin()
void TransferDbgValues(SDValue From, SDValue To)
Transfer SDDbgValues.
void erase(const SDNode *Node)
Invalidate all DbgValues attached to the node and remove it from the Node-to-DbgValues map...
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
SDDbgValue - Holds the information from a dbg_value node through SDISel.
static void Profile(const SDVTListNode &X, FoldingSetNodeID &ID)
SDValue getAtomicCmpSwap(unsigned Opcode, SDLoc dl, EVT MemVT, SDVTList VTs, SDValue Chain, SDValue Ptr, SDValue Cmp, SDValue Swp, MachinePointerInfo PtrInfo, unsigned Alignment, AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering, SynchronizationScope SynchScope)
Gets a node for an atomic cmpxchg op.
MVT getSimpleVT() const
getSimpleVT - Return the SimpleValueType held in the specified simple EVT.
SDValue getIntPtrConstant(uint64_t Val, SDLoc DL, bool isTarget=false)
SDValue getMemIntrinsicNode(unsigned Opcode, SDLoc dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, unsigned Align=0, bool Vol=false, bool ReadMem=true, bool WriteMem=true, unsigned Size=0)
Creates a MemIntrinsicNode that may produce a result and takes a list of operands.
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
unsigned getVectorNumElements() const
getVectorNumElements - Given a vector type, return the number of elements it contains.
This class is used to represent ISD::LOAD nodes.