14 #ifndef LLVM_CODEGEN_SELECTIONDAG_H 15 #define LLVM_CODEGEN_SELECTIONDAG_H 61 class BlockFrequencyInfo;
69 class LegacyDivergenceAnalysis;
71 class MachineBasicBlock;
72 class MachineConstantPoolValue;
74 class OptimizationRemarkEmitter;
75 class ProfileSummaryInfo;
79 class SelectionDAGTargetInfo;
80 class TargetLibraryInfo;
83 class TargetSubtargetInfo;
103 FastID(ID), VTs(VT), NumVTs(Num) {
122 if (X.HashValue != IDHash)
124 return ID == X.FastID;
167 DbgValMap[
Node].push_back(V);
181 ByvalParmDbgValues.
clear();
189 return DbgValues.
empty() && ByvalParmDbgValues.
empty() && DbgLabels.
empty();
193 auto I = DbgValMap.
find(Node);
194 if (
I != DbgValMap.
end())
229 Pass *SDAGISelPass =
nullptr;
266 BumpPtrAllocator OperandAllocator;
278 struct CallSiteDbgInfo {
280 MDNode *HeapAllocSite =
nullptr;
299 : Next(D.UpdateListeners), DAG(D) {
300 DAG.UpdateListeners =
this;
304 assert(DAG.UpdateListeners ==
this &&
305 "DAGUpdateListeners must be destroyed in LIFO order");
306 DAG.UpdateListeners = Next;
311 virtual void NodeDeleted(SDNode *
N, SDNode *
E);
314 virtual void NodeUpdated(SDNode *N);
317 virtual void NodeInserted(SDNode *N);
330 virtual void anchor();
338 bool NewNodesMustHaveLegalTypes =
false;
350 bool setSubgraphColorHelper(SDNode *
N,
const char *
Color,
352 int level,
bool &printed);
354 template <
typename SDNodeT,
typename... ArgTypes>
355 SDNodeT *newSDNode(ArgTypes &&...
Args) {
356 return new (NodeAllocator.template Allocate<SDNodeT>())
357 SDNodeT(std::forward<ArgTypes>(
Args)...);
366 template <
typename SDNodeT,
typename... ArgTypes>
367 static uint16_t getSyntheticNodeSubclassData(
unsigned IROrder,
368 ArgTypes &&...
Args) {
372 return SDNodeT(IROrder,
DebugLoc(), std::forward<ArgTypes>(
Args)...)
373 .getRawSubclassData();
376 template <
typename SDNodeTy>
377 static uint16_t getSyntheticNodeSubclassData(
unsigned Opc,
unsigned Order,
380 return SDNodeTy(Opc, Order,
DebugLoc(), VTs, MemoryVT, MMO)
381 .getRawSubclassData();
387 if (!Node->OperandList)
392 Node->NumOperands = 0;
393 Node->OperandList =
nullptr;
395 void CreateTopologicalOrder(std::vector<SDNode*>& Order);
399 static constexpr
unsigned MaxRecursionDepth = 6;
436 void viewGraph(
const std::string &Title);
445 void clearGraphAttrs();
448 void setGraphAttrs(
const SDNode *
N,
const char *
Attrs);
452 const std::string getGraphAttrs(
const SDNode *
N)
const;
455 void setGraphColor(
const SDNode *
N,
const char *
Color);
458 void setSubgraphColor(SDNode *
N,
const char *
Color);
471 return AllNodes.size();
475 return make_range(allnodes_begin(), allnodes_end());
478 return make_range(allnodes_begin(), allnodes_end());
486 return SDValue(const_cast<SDNode *>(&EntryNode), 0);
493 "DAG root value is not a chain!");
503 void VerifyDAGDiverence();
519 bool LegalizeTypes();
561 bool LegalizeVectors();
564 void RemoveDeadNodes();
568 void DeleteNode(SDNode *N);
587 bool isTarget =
false,
bool isOpaque =
false);
589 bool isTarget =
false,
bool isOpaque =
false);
592 bool IsOpaque =
false) {
594 VT, IsTarget, IsOpaque);
598 bool isTarget =
false,
bool isOpaque =
false);
599 SDValue getIntPtrConstant(uint64_t Val,
const SDLoc &DL,
600 bool isTarget =
false);
602 bool LegalTypes =
true);
605 bool isOpaque =
false) {
606 return getConstant(Val, DL, VT,
true, isOpaque);
609 bool isOpaque =
false) {
610 return getConstant(Val, DL, VT,
true, isOpaque);
613 bool isOpaque =
false) {
614 return getConstant(Val, DL, VT,
true, isOpaque);
631 bool isTarget =
false);
633 bool isTarget =
false);
635 bool isTarget =
false);
637 return getConstantFP(Val, DL, VT,
true);
640 return getConstantFP(Val, DL, VT,
true);
643 return getConstantFP(Val, DL, VT,
true);
648 int64_t offset = 0,
bool isTargetGA =
false,
649 unsigned TargetFlags = 0);
651 int64_t offset = 0,
unsigned TargetFlags = 0) {
652 return getGlobalAddress(GV, DL, VT, offset,
true, TargetFlags);
654 SDValue getFrameIndex(
int FI,
EVT VT,
bool isTarget =
false);
656 return getFrameIndex(FI, VT,
true);
658 SDValue getJumpTable(
int JTI,
EVT VT,
bool isTarget =
false,
659 unsigned TargetFlags = 0);
661 return getJumpTable(JTI, VT,
true, TargetFlags);
664 int Offs = 0,
bool isT =
false,
665 unsigned TargetFlags = 0);
667 int Offset = 0,
unsigned TargetFlags = 0) {
668 return getConstantPool(C, VT,
Align,
Offset,
true, TargetFlags);
671 unsigned Align = 0,
int Offs = 0,
bool isT=
false,
672 unsigned TargetFlags = 0);
675 unsigned TargetFlags = 0) {
676 return getConstantPool(C, VT,
Align,
Offset,
true, TargetFlags);
679 unsigned TargetFlags = 0);
684 SDValue getExternalSymbol(
const char *Sym,
EVT VT);
686 SDValue getTargetExternalSymbol(
const char *Sym,
EVT VT,
687 unsigned TargetFlags = 0);
697 bool isTarget =
false,
unsigned TargetFlags = 0);
699 int64_t
Offset = 0,
unsigned TargetFlags = 0) {
700 return getBlockAddress(BA, VT,
Offset,
true, TargetFlags);
731 SDValue Ops[] = { Chain, getRegister(Reg, VT) };
741 SDValue Ops[] = { Chain, getRegister(Reg, VT), Glue };
781 "A splatted value must have a width equal or (for integers) " 782 "greater than the vector element type!");
797 "A splatted value must have a width equal or (for integers) " 798 "greater than the vector element type!");
816 std::pair<SDValue, SDValue>
869 return getMemBasePlusOffset(Ptr, Offset, SL, Flags);
877 return getMemBasePlusOffset(Ptr, Offset, SL, Flags);
887 getIntPtrConstant(InSize, DL,
true),
888 getIntPtrConstant(OutSize, DL,
true) };
969 SDValue Size,
unsigned Align,
bool isVol,
bool isTailCall,
974 SDValue Size,
unsigned Align,
bool isVol,
bool isTailCall,
978 unsigned DstAlign,
SDValue Src,
unsigned SrcAlign,
984 unsigned DstAlign,
SDValue Src,
unsigned SrcAlign,
991 Type *SizeTy,
unsigned ElemSz,
bool isTailCall,
998 bool IsSignaling =
false) {
1000 "Cannot compare scalars to vectors");
1002 "Cannot compare scalars to vectors");
1004 "Cannot create a setCC of an invalid node.");
1016 "Cannot use select on differing types");
1018 "Cannot mix vectors and scalars");
1020 return getNode(Opcode, DL, VT, Cond, LHS, RHS);
1092 int FrameIndex, int64_t Size, int64_t Offset = -1);
1106 const MDNode *Ranges =
nullptr);
1112 unsigned Alignment = 0,
1125 const MDNode *Ranges =
nullptr);
1160 bool IsTruncating =
false,
bool IsCompressing =
false);
1173 template <
class TargetMemSDNode>
1179 SDValue getSrcValue(
const Value *v);
1197 SDValue expandVAArg(SDNode *Node);
1200 SDValue expandVACopy(SDNode *Node);
1207 Function **TargetFunction =
nullptr);
1215 SDNode *UpdateNodeOperands(SDNode *N,
SDValue Op);
1236 void updateDivergence(SDNode * N);
1242 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT);
1243 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
SDValue Op1);
1244 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
1246 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
1248 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT,
1250 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
EVT VT2);
1251 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
1253 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
1255 SDNode *SelectNodeTo(SDNode *N,
unsigned TargetOpc,
EVT VT1,
1257 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
EVT VT1,
1259 SDNode *SelectNodeTo(SDNode *N,
unsigned MachineOpc,
SDVTList VTs,
1264 SDNode *MorphNodeTo(SDNode *N,
unsigned Opc,
SDVTList VTs,
1270 SDNode *mutateStrictFPToFP(SDNode *Node);
1319 unsigned R,
bool IsIndirect,
const DebugLoc &DL,
1324 const Value *C,
const DebugLoc &DL,
1329 unsigned FI,
bool IsIndirect,
1334 unsigned VReg,
bool IsIndirect,
1344 unsigned SizeInBits = 0,
bool InvalidateDbg =
true);
1349 void RemoveDeadNode(SDNode *N);
1371 void ReplaceAllUsesWith(SDNode *From, SDNode *To);
1372 void ReplaceAllUsesWith(SDNode *From,
const SDValue *To);
1381 void ReplaceAllUsesOfValuesWith(
const SDValue *From,
const SDValue *To,
1394 unsigned AssignTopologicalOrder();
1419 void AddDbgValue(
SDDbgValue *DB, SDNode *SD,
bool isParameter);
1459 SDValue CreateStackTemporary(
EVT VT,
unsigned minAlign = 1);
1465 SDValue FoldSymbolOffset(
unsigned Opcode,
EVT VT,
1469 SDValue FoldConstantArithmetic(
unsigned Opcode,
const SDLoc &DL,
EVT VT,
1470 SDNode *N1, SDNode *N2);
1472 SDValue FoldConstantArithmetic(
unsigned Opcode,
const SDLoc &DL,
EVT VT,
1476 SDValue FoldConstantVectorArithmetic(
unsigned Opcode,
const SDLoc &DL,
EVT VT,
1505 const APInt &DemandedElts);
1509 bool SignBitIsZero(
SDValue Op,
unsigned Depth = 0)
const;
1515 unsigned Depth = 0)
const;
1521 const APInt &DemandedElts,
unsigned Depth = 0)
const;
1525 bool MaskedValueIsAllOnes(
SDValue Op,
const APInt &Mask,
1526 unsigned Depth = 0)
const;
1541 unsigned Depth = 0)
const;
1579 unsigned Depth = 0)
const;
1586 bool isBaseWithConstantOffset(
SDValue Op)
const;
1600 bool isKnownNeverZeroFloat(
SDValue Op)
const;
1603 bool isKnownNeverZero(
SDValue Op)
const;
1643 bool AllowPartials =
false);
1651 SDValue UnrollVectorOp(SDNode *N,
unsigned ResNE = 0);
1655 std::pair<SDValue, SDValue> UnrollVectorOverflowOp(SDNode *N,
1656 unsigned ResNE = 0);
1663 unsigned Bytes,
int Dist)
const;
1667 unsigned InferPtrAlignment(
SDValue Ptr)
const;
1671 std::pair<EVT, EVT> GetSplitDestVTs(
const EVT &VT)
const;
1675 std::pair<SDValue, SDValue> SplitVector(
const SDValue &N,
const SDLoc &DL,
1676 const EVT &LoVT,
const EVT &HiVT);
1681 std::tie(LoVT, HiVT) = GetSplitDestVTs(N.
getValueType());
1682 return SplitVector(N, DL, LoVT, HiVT);
1698 unsigned Start = 0,
unsigned Count = 0);
1701 unsigned getEVTAlignment(
EVT MemoryVT)
const;
1704 SDNode *isConstantIntBuildVectorOrConstantInt(
SDValue N);
1712 return isConstantIntBuildVectorOrConstantInt(N) ||
1717 SDCallSiteDbgInfo[CallNode].CSInfo = std::move(
CallInfo);
1721 auto I = SDCallSiteDbgInfo.
find(CallNode);
1722 if (
I != SDCallSiteDbgInfo.
end())
1723 return std::move(
I->second).CSInfo;
1728 SDCallSiteDbgInfo[
Node].HeapAllocSite = MD;
1733 auto It = SDCallSiteDbgInfo.
find(Node);
1734 if (It == SDCallSiteDbgInfo.
end())
1736 return It->second.HeapAllocSite;
1745 bool shouldOptForSize()
const;
1748 void InsertNode(SDNode *N);
1749 bool RemoveNodeFromCSEMaps(SDNode *N);
1750 void AddModifiedNodeToCSEMaps(SDNode *N);
1751 SDNode *FindModifiedNodeSlot(SDNode *N,
SDValue Op,
void *&InsertPos);
1752 SDNode *FindModifiedNodeSlot(SDNode *N,
SDValue Op1,
SDValue Op2,
1756 SDNode *UpdateSDLocOnMergeSDNode(SDNode *N,
const SDLoc &loc);
1758 void DeleteNodeNotInCSEMaps(SDNode *N);
1759 void DeallocateNode(SDNode *N);
1761 void allnodes_clear();
1779 std::vector<CondCodeSDNode*> CondCodeNodes;
1781 std::vector<SDNode*> ValueTypeNodes;
1782 std::map<EVT, SDNode*, EVT::compareRawBits> ExtendedValueTypeNodes;
1785 std::map<std::pair<std::string, unsigned>, SDNode *> TargetExternalSymbols;
1801 template <
class TargetMemSDNode>
1812 for (
auto& Op : Ops) {
1818 ID.
AddInteger(getSyntheticNodeSubclassData<TargetMemSDNode>(
1822 if (SDNode *
E = FindNodeOrInsertPos(ID, dl, IP)) {
1823 cast<TargetMemSDNode>(
E)->refineAlignment(MMO);
1830 createOperands(N, Ops);
1838 #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. ...
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 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()
const Value * getSplatValue(const Value *V)
Get splat value if the input is a splat vector or return nullptr.
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...
Analysis providing profile information.
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...
SPLAT_VECTOR(VAL) - Returns a vector with the scalar value VAL duplicated in all lanes.
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...
SDDbgInfo::DbgLabelIterator DbgLabelBegin() const
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")
The address of a basic block.
ProfileSummaryInfo * getPSI() const
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. ...
SDDbgInfo::DbgIterator DbgEnd() const
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.
CallSiteInfo getSDCallSiteInfo(const SDNode *CallNode)
static Optional< unsigned > getOpcode(ArrayRef< VPValue *> Values)
Returns the opcode of Values or ~0 if they do not all agree.
SDValue getObjectPtrOffset(const SDLoc &SL, SDValue Ptr, int64_t Offset)
Create an add instruction with appropriate flags when used for addressing some offset of an object...
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...
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned TargetFlags=0)
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
SmallVectorImpl< ArgRegPair > CallSiteInfoImpl
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()
void InsertNode(T *N, void *InsertPos)
InsertNode - Insert the specified node into the folding set, knowing that it is not already in the fo...
STRICT_FSETCC/STRICT_FSETCCS - Constrained versions of SETCC, used for floating-point operands only...
SDValue getObjectPtrOffset(const SDLoc &SL, SDValue Ptr, SDValue Offset)
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...
bool isSplatValue(const Value *V, unsigned Depth=0)
Return true if the input value is known to be a vector with all identical elements (potentially inclu...
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
MemIndexType
MemIndexType enum - This enum defines how to interpret MGATHER/SCATTER's index parameter when calcula...
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.
DenormalMode getDenormalMode(EVT VT) const
Return the current function's default denormal handling kind for the given floating point type...
SDDbgInfo::DbgIterator DbgBegin() const
allnodes_iterator allnodes_begin()
SDValue getTargetConstantFP(double Val, const SDLoc &DL, EVT VT)
static SDValue WidenVector(SDValue V64Reg, SelectionDAG &DAG)
WidenVector - Given a value in the V64 register class, produce the equivalent value in the V128 regis...
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)
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.
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
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.
SDValue getTargetConstantPool(MachineConstantPoolValue *C, EVT VT, unsigned Align=0, int Offset=0, unsigned TargetFlags=0)
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
const LegacyDivergenceAnalysis * getDivergenceAnalysis() 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.
SDDbgInfo::DbgIterator ByvalParmDbgEnd() const
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.
SDValue getSplatVector(EVT VT, const SDLoc &DL, SDValue Op)
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 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.
This struct is a compact representation of a valid (non-zero power of two) alignment.
SmallVector< ArgRegPair, 1 > CallSiteInfo
Vector of call argument and its forwarding register.
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned TargetFlags=0)
The memory access writes data.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
static bool isUndef(ArrayRef< int > Mask)
static const fltSemantics & IEEEsingle() LLVM_READNONE
const TargetLowering & getTargetLoweringInfo() const
SDValue getTargetConstantPool(const Constant *C, EVT VT, unsigned Align=0, int Offset=0, unsigned TargetFlags=0)
A SetVector that performs no allocations if smaller than a certain size.
Iterator for intrusive lists based on ilist_node.
MDNode * getHeapAllocSite(const SDNode *Node)
Return the HeapAllocSite type associated with the SDNode, if it exists.
void setNoUnsignedWrap(bool b)
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned TargetFlags=0)
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.
void addCallSiteInfo(const SDNode *CallNode, CallSiteInfoImpl &&CallInfo)
const DebugLoc & getDebugLoc() const
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)
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
SDDbgInfo::DbgLabelIterator DbgLabelEnd() const
static void clear(coro::Shape &Shape)
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)
BlockFrequencyInfo * getBFI() const
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
void addHeapAllocSite(const SDNode *Node, MDNode *MD)
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...
SDDbgInfo::DbgIterator ByvalParmDbgBegin() const
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())
TypeSize getScalarSizeInBits() const
LLVM Value Representation.
unsigned getResNo() const
get the index which selects a specific result in the SDNode
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...
DenormalMode
Represent handled modes for denormal (aka subnormal) modes in the floating point environment.
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()
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
DenormalMode getDenormalMode(const fltSemantics &FPType) const
Returns the denormal handling type for the default rounding mode of the function. ...
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
unsigned getIROrder() const
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
This class is used to represent ISD::LOAD nodes.