LLVM  14.0.0git
SelectionDAGNodes.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/SelectionDAGNodes.h - SelectionDAG Nodes ----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the SDNode class and derived classes, which are used to
10 // represent the nodes and operations present in a SelectionDAG. These nodes
11 // and operations are machine code level operations, with some similarities to
12 // the GCC RTL representation.
13 //
14 // Clients should include the SelectionDAG.h file instead of this file directly.
15 //
16 //===----------------------------------------------------------------------===//
17 
18 #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
19 #define LLVM_CODEGEN_SELECTIONDAGNODES_H
20 
21 #include "llvm/ADT/APFloat.h"
22 #include "llvm/ADT/ArrayRef.h"
23 #include "llvm/ADT/BitVector.h"
24 #include "llvm/ADT/FoldingSet.h"
25 #include "llvm/ADT/GraphTraits.h"
26 #include "llvm/ADT/SmallPtrSet.h"
27 #include "llvm/ADT/SmallVector.h"
28 #include "llvm/ADT/ilist_node.h"
29 #include "llvm/ADT/iterator.h"
33 #include "llvm/CodeGen/Register.h"
35 #include "llvm/IR/Constants.h"
36 #include "llvm/IR/DebugLoc.h"
37 #include "llvm/IR/Instruction.h"
38 #include "llvm/IR/Instructions.h"
39 #include "llvm/IR/Metadata.h"
40 #include "llvm/IR/Operator.h"
41 #include "llvm/Support/AlignOf.h"
43 #include "llvm/Support/Casting.h"
46 #include "llvm/Support/TypeSize.h"
47 #include <algorithm>
48 #include <cassert>
49 #include <climits>
50 #include <cstddef>
51 #include <cstdint>
52 #include <cstring>
53 #include <iterator>
54 #include <string>
55 #include <tuple>
56 
57 namespace llvm {
58 
59 class APInt;
60 class Constant;
61 class GlobalValue;
62 class MachineBasicBlock;
63 class MachineConstantPoolValue;
64 class MCSymbol;
65 class raw_ostream;
66 class SDNode;
67 class SelectionDAG;
68 class Type;
69 class Value;
70 
71 void checkForCycles(const SDNode *N, const SelectionDAG *DAG = nullptr,
72  bool force = false);
73 
74 /// This represents a list of ValueType's that has been intern'd by
75 /// a SelectionDAG. Instances of this simple value class are returned by
76 /// SelectionDAG::getVTList(...).
77 ///
78 struct SDVTList {
79  const EVT *VTs;
80  unsigned int NumVTs;
81 };
82 
83 namespace ISD {
84 
85  /// Node predicates
86 
87 /// If N is a BUILD_VECTOR or SPLAT_VECTOR node whose elements are all the
88 /// same constant or undefined, return true and return the constant value in
89 /// \p SplatValue.
90 bool isConstantSplatVector(const SDNode *N, APInt &SplatValue);
91 
92 /// Return true if the specified node is a BUILD_VECTOR or SPLAT_VECTOR where
93 /// all of the elements are ~0 or undef. If \p BuildVectorOnly is set to
94 /// true, it only checks BUILD_VECTOR.
96  bool BuildVectorOnly = false);
97 
98 /// Return true if the specified node is a BUILD_VECTOR or SPLAT_VECTOR where
99 /// all of the elements are 0 or undef. If \p BuildVectorOnly is set to true, it
100 /// only checks BUILD_VECTOR.
102  bool BuildVectorOnly = false);
103 
104 /// Return true if the specified node is a BUILD_VECTOR where all of the
105 /// elements are ~0 or undef.
106 bool isBuildVectorAllOnes(const SDNode *N);
107 
108 /// Return true if the specified node is a BUILD_VECTOR where all of the
109 /// elements are 0 or undef.
110 bool isBuildVectorAllZeros(const SDNode *N);
111 
112 /// Return true if the specified node is a BUILD_VECTOR node of all
113 /// ConstantSDNode or undef.
115 
116 /// Return true if the specified node is a BUILD_VECTOR node of all
117 /// ConstantFPSDNode or undef.
119 
120 /// Return true if the node has at least one operand and all operands of the
121 /// specified node are ISD::UNDEF.
122 bool allOperandsUndef(const SDNode *N);
123 
124 } // end namespace ISD
125 
126 //===----------------------------------------------------------------------===//
127 /// Unlike LLVM values, Selection DAG nodes may return multiple
128 /// values as the result of a computation. Many nodes return multiple values,
129 /// from loads (which define a token and a return value) to ADDC (which returns
130 /// a result and a carry value), to calls (which may return an arbitrary number
131 /// of values).
132 ///
133 /// As such, each use of a SelectionDAG computation must indicate the node that
134 /// computes it as well as which return value to use from that node. This pair
135 /// of information is represented with the SDValue value type.
136 ///
137 class SDValue {
138  friend struct DenseMapInfo<SDValue>;
139 
140  SDNode *Node = nullptr; // The node defining the value we are using.
141  unsigned ResNo = 0; // Which return value of the node we are using.
142 
143 public:
144  SDValue() = default;
145  SDValue(SDNode *node, unsigned resno);
146 
147  /// get the index which selects a specific result in the SDNode
148  unsigned getResNo() const { return ResNo; }
149 
150  /// get the SDNode which holds the desired result
151  SDNode *getNode() const { return Node; }
152 
153  /// set the SDNode
154  void setNode(SDNode *N) { Node = N; }
155 
156  inline SDNode *operator->() const { return Node; }
157 
158  bool operator==(const SDValue &O) const {
159  return Node == O.Node && ResNo == O.ResNo;
160  }
161  bool operator!=(const SDValue &O) const {
162  return !operator==(O);
163  }
164  bool operator<(const SDValue &O) const {
165  return std::tie(Node, ResNo) < std::tie(O.Node, O.ResNo);
166  }
167  explicit operator bool() const {
168  return Node != nullptr;
169  }
170 
171  SDValue getValue(unsigned R) const {
172  return SDValue(Node, R);
173  }
174 
175  /// Return true if this node is an operand of N.
176  bool isOperandOf(const SDNode *N) const;
177 
178  /// Return the ValueType of the referenced return value.
179  inline EVT getValueType() const;
180 
181  /// Return the simple ValueType of the referenced return value.
183  return getValueType().getSimpleVT();
184  }
185 
186  /// Returns the size of the value in bits.
187  ///
188  /// If the value type is a scalable vector type, the scalable property will
189  /// be set and the runtime size will be a positive integer multiple of the
190  /// base size.
192  return getValueType().getSizeInBits();
193  }
194 
197  }
198 
199  // Forwarding methods - These forward to the corresponding methods in SDNode.
200  inline unsigned getOpcode() const;
201  inline unsigned getNumOperands() const;
202  inline const SDValue &getOperand(unsigned i) const;
203  inline uint64_t getConstantOperandVal(unsigned i) const;
204  inline const APInt &getConstantOperandAPInt(unsigned i) const;
205  inline bool isTargetMemoryOpcode() const;
206  inline bool isTargetOpcode() const;
207  inline bool isMachineOpcode() const;
208  inline bool isUndef() const;
209  inline unsigned getMachineOpcode() const;
210  inline const DebugLoc &getDebugLoc() const;
211  inline void dump() const;
212  inline void dump(const SelectionDAG *G) const;
213  inline void dumpr() const;
214  inline void dumpr(const SelectionDAG *G) const;
215 
216  /// Return true if this operand (which must be a chain) reaches the
217  /// specified operand without crossing any side-effecting instructions.
218  /// In practice, this looks through token factors and non-volatile loads.
219  /// In order to remain efficient, this only
220  /// looks a couple of nodes in, it does not do an exhaustive search.
222  unsigned Depth = 2) const;
223 
224  /// Return true if there are no nodes using value ResNo of Node.
225  inline bool use_empty() const;
226 
227  /// Return true if there is exactly one node using value ResNo of Node.
228  inline bool hasOneUse() const;
229 };
230 
231 template<> struct DenseMapInfo<SDValue> {
232  static inline SDValue getEmptyKey() {
233  SDValue V;
234  V.ResNo = -1U;
235  return V;
236  }
237 
238  static inline SDValue getTombstoneKey() {
239  SDValue V;
240  V.ResNo = -2U;
241  return V;
242  }
243 
244  static unsigned getHashValue(const SDValue &Val) {
245  return ((unsigned)((uintptr_t)Val.getNode() >> 4) ^
246  (unsigned)((uintptr_t)Val.getNode() >> 9)) + Val.getResNo();
247  }
248 
249  static bool isEqual(const SDValue &LHS, const SDValue &RHS) {
250  return LHS == RHS;
251  }
252 };
253 
254 /// Allow casting operators to work directly on
255 /// SDValues as if they were SDNode*'s.
256 template<> struct simplify_type<SDValue> {
257  using SimpleType = SDNode *;
258 
260  return Val.getNode();
261  }
262 };
263 template<> struct simplify_type<const SDValue> {
264  using SimpleType = /*const*/ SDNode *;
265 
266  static SimpleType getSimplifiedValue(const SDValue &Val) {
267  return Val.getNode();
268  }
269 };
270 
271 /// Represents a use of a SDNode. This class holds an SDValue,
272 /// which records the SDNode being used and the result number, a
273 /// pointer to the SDNode using the value, and Next and Prev pointers,
274 /// which link together all the uses of an SDNode.
275 ///
276 class SDUse {
277  /// Val - The value being used.
278  SDValue Val;
279  /// User - The user of this value.
280  SDNode *User = nullptr;
281  /// Prev, Next - Pointers to the uses list of the SDNode referred by
282  /// this operand.
283  SDUse **Prev = nullptr;
284  SDUse *Next = nullptr;
285 
286 public:
287  SDUse() = default;
288  SDUse(const SDUse &U) = delete;
289  SDUse &operator=(const SDUse &) = delete;
290 
291  /// Normally SDUse will just implicitly convert to an SDValue that it holds.
292  operator const SDValue&() const { return Val; }
293 
294  /// If implicit conversion to SDValue doesn't work, the get() method returns
295  /// the SDValue.
296  const SDValue &get() const { return Val; }
297 
298  /// This returns the SDNode that contains this Use.
299  SDNode *getUser() { return User; }
300 
301  /// Get the next SDUse in the use list.
302  SDUse *getNext() const { return Next; }
303 
304  /// Convenience function for get().getNode().
305  SDNode *getNode() const { return Val.getNode(); }
306  /// Convenience function for get().getResNo().
307  unsigned getResNo() const { return Val.getResNo(); }
308  /// Convenience function for get().getValueType().
309  EVT getValueType() const { return Val.getValueType(); }
310 
311  /// Convenience function for get().operator==
312  bool operator==(const SDValue &V) const {
313  return Val == V;
314  }
315 
316  /// Convenience function for get().operator!=
317  bool operator!=(const SDValue &V) const {
318  return Val != V;
319  }
320 
321  /// Convenience function for get().operator<
322  bool operator<(const SDValue &V) const {
323  return Val < V;
324  }
325 
326 private:
327  friend class SelectionDAG;
328  friend class SDNode;
329  // TODO: unfriend HandleSDNode once we fix its operand handling.
330  friend class HandleSDNode;
331 
332  void setUser(SDNode *p) { User = p; }
333 
334  /// Remove this use from its existing use list, assign it the
335  /// given value, and add it to the new value's node's use list.
336  inline void set(const SDValue &V);
337  /// Like set, but only supports initializing a newly-allocated
338  /// SDUse with a non-null value.
339  inline void setInitial(const SDValue &V);
340  /// Like set, but only sets the Node portion of the value,
341  /// leaving the ResNo portion unmodified.
342  inline void setNode(SDNode *N);
343 
344  void addToList(SDUse **List) {
345  Next = *List;
346  if (Next) Next->Prev = &Next;
347  Prev = List;
348  *List = this;
349  }
350 
351  void removeFromList() {
352  *Prev = Next;
353  if (Next) Next->Prev = Prev;
354  }
355 };
356 
357 /// simplify_type specializations - Allow casting operators to work directly on
358 /// SDValues as if they were SDNode*'s.
359 template<> struct simplify_type<SDUse> {
360  using SimpleType = SDNode *;
361 
363  return Val.getNode();
364  }
365 };
366 
367 /// These are IR-level optimization flags that may be propagated to SDNodes.
368 /// TODO: This data structure should be shared by the IR optimizer and the
369 /// the backend.
370 struct SDNodeFlags {
371 private:
372  bool NoUnsignedWrap : 1;
373  bool NoSignedWrap : 1;
374  bool Exact : 1;
375  bool NoNaNs : 1;
376  bool NoInfs : 1;
377  bool NoSignedZeros : 1;
378  bool AllowReciprocal : 1;
379  bool AllowContract : 1;
380  bool ApproximateFuncs : 1;
381  bool AllowReassociation : 1;
382 
383  // We assume instructions do not raise floating-point exceptions by default,
384  // and only those marked explicitly may do so. We could choose to represent
385  // this via a positive "FPExcept" flags like on the MI level, but having a
386  // negative "NoFPExcept" flag here (that defaults to true) makes the flag
387  // intersection logic more straightforward.
388  bool NoFPExcept : 1;
389 
390 public:
391  /// Default constructor turns off all optimization flags.
393  : NoUnsignedWrap(false), NoSignedWrap(false), Exact(false), NoNaNs(false),
394  NoInfs(false), NoSignedZeros(false), AllowReciprocal(false),
395  AllowContract(false), ApproximateFuncs(false),
396  AllowReassociation(false), NoFPExcept(false) {}
397 
398  /// Propagate the fast-math-flags from an IR FPMathOperator.
399  void copyFMF(const FPMathOperator &FPMO) {
400  setNoNaNs(FPMO.hasNoNaNs());
401  setNoInfs(FPMO.hasNoInfs());
407  }
408 
409  // These are mutators for each flag.
410  void setNoUnsignedWrap(bool b) { NoUnsignedWrap = b; }
411  void setNoSignedWrap(bool b) { NoSignedWrap = b; }
412  void setExact(bool b) { Exact = b; }
413  void setNoNaNs(bool b) { NoNaNs = b; }
414  void setNoInfs(bool b) { NoInfs = b; }
415  void setNoSignedZeros(bool b) { NoSignedZeros = b; }
416  void setAllowReciprocal(bool b) { AllowReciprocal = b; }
417  void setAllowContract(bool b) { AllowContract = b; }
418  void setApproximateFuncs(bool b) { ApproximateFuncs = b; }
419  void setAllowReassociation(bool b) { AllowReassociation = b; }
420  void setNoFPExcept(bool b) { NoFPExcept = b; }
421 
422  // These are accessors for each flag.
423  bool hasNoUnsignedWrap() const { return NoUnsignedWrap; }
424  bool hasNoSignedWrap() const { return NoSignedWrap; }
425  bool hasExact() const { return Exact; }
426  bool hasNoNaNs() const { return NoNaNs; }
427  bool hasNoInfs() const { return NoInfs; }
428  bool hasNoSignedZeros() const { return NoSignedZeros; }
429  bool hasAllowReciprocal() const { return AllowReciprocal; }
430  bool hasAllowContract() const { return AllowContract; }
431  bool hasApproximateFuncs() const { return ApproximateFuncs; }
432  bool hasAllowReassociation() const { return AllowReassociation; }
433  bool hasNoFPExcept() const { return NoFPExcept; }
434 
435  /// Clear any flags in this flag set that aren't also set in Flags. All
436  /// flags will be cleared if Flags are undefined.
437  void intersectWith(const SDNodeFlags Flags) {
438  NoUnsignedWrap &= Flags.NoUnsignedWrap;
439  NoSignedWrap &= Flags.NoSignedWrap;
440  Exact &= Flags.Exact;
441  NoNaNs &= Flags.NoNaNs;
442  NoInfs &= Flags.NoInfs;
443  NoSignedZeros &= Flags.NoSignedZeros;
444  AllowReciprocal &= Flags.AllowReciprocal;
445  AllowContract &= Flags.AllowContract;
446  ApproximateFuncs &= Flags.ApproximateFuncs;
447  AllowReassociation &= Flags.AllowReassociation;
448  NoFPExcept &= Flags.NoFPExcept;
449  }
450 };
451 
452 /// Represents one node in the SelectionDAG.
453 ///
454 class SDNode : public FoldingSetNode, public ilist_node<SDNode> {
455 private:
456  /// The operation that this node performs.
457  int16_t NodeType;
458 
459 protected:
460  // We define a set of mini-helper classes to help us interpret the bits in our
461  // SubclassData. These are designed to fit within a uint16_t so they pack
462  // with NodeType.
463 
464 #if defined(_AIX) && (!defined(__GNUC__) || defined(__clang__))
465 // Except for GCC; by default, AIX compilers store bit-fields in 4-byte words
466 // and give the `pack` pragma push semantics.
467 #define BEGIN_TWO_BYTE_PACK() _Pragma("pack(2)")
468 #define END_TWO_BYTE_PACK() _Pragma("pack(pop)")
469 #else
470 #define BEGIN_TWO_BYTE_PACK()
471 #define END_TWO_BYTE_PACK()
472 #endif
473 
476  friend class SDNode;
477  friend class MemIntrinsicSDNode;
478  friend class MemSDNode;
479  friend class SelectionDAG;
480 
481  uint16_t HasDebugValue : 1;
482  uint16_t IsMemIntrinsic : 1;
483  uint16_t IsDivergent : 1;
484  };
485  enum { NumSDNodeBits = 3 };
486 
488  friend class ConstantSDNode;
489 
491 
492  uint16_t IsOpaque : 1;
493  };
494 
496  friend class MemSDNode;
497  friend class MemIntrinsicSDNode;
498  friend class AtomicSDNode;
499 
501 
502  uint16_t IsVolatile : 1;
503  uint16_t IsNonTemporal : 1;
504  uint16_t IsDereferenceable : 1;
505  uint16_t IsInvariant : 1;
506  };
508 
510  friend class LSBaseSDNode;
511  friend class VPLoadStoreSDNode;
512  friend class MaskedLoadStoreSDNode;
514  friend class VPGatherScatterSDNode;
515 
517 
518  // This storage is shared between disparate class hierarchies to hold an
519  // enumeration specific to the class hierarchy in use.
520  // LSBaseSDNode => enum ISD::MemIndexedMode
521  // VPLoadStoreBaseSDNode => enum ISD::MemIndexedMode
522  // MaskedLoadStoreBaseSDNode => enum ISD::MemIndexedMode
523  // VPGatherScatterSDNode => enum ISD::MemIndexType
524  // MaskedGatherScatterSDNode => enum ISD::MemIndexType
526  };
528 
530  friend class LoadSDNode;
531  friend class VPLoadSDNode;
532  friend class MaskedLoadSDNode;
533  friend class MaskedGatherSDNode;
534  friend class VPGatherSDNode;
535 
537 
538  uint16_t ExtTy : 2; // enum ISD::LoadExtType
539  uint16_t IsExpanding : 1;
540  };
541 
543  friend class StoreSDNode;
544  friend class VPStoreSDNode;
545  friend class MaskedStoreSDNode;
546  friend class MaskedScatterSDNode;
547  friend class VPScatterSDNode;
548 
550 
551  uint16_t IsTruncating : 1;
552  uint16_t IsCompressing : 1;
553  };
554 
555  union {
556  char RawSDNodeBits[sizeof(uint16_t)];
563  };
565 #undef BEGIN_TWO_BYTE_PACK
566 #undef END_TWO_BYTE_PACK
567 
568  // RawSDNodeBits must cover the entirety of the union. This means that all of
569  // the union's members must have size <= RawSDNodeBits. We write the RHS as
570  // "2" instead of sizeof(RawSDNodeBits) because MSVC can't handle the latter.
571  static_assert(sizeof(SDNodeBitfields) <= 2, "field too wide");
572  static_assert(sizeof(ConstantSDNodeBitfields) <= 2, "field too wide");
573  static_assert(sizeof(MemSDNodeBitfields) <= 2, "field too wide");
574  static_assert(sizeof(LSBaseSDNodeBitfields) <= 2, "field too wide");
575  static_assert(sizeof(LoadSDNodeBitfields) <= 2, "field too wide");
576  static_assert(sizeof(StoreSDNodeBitfields) <= 2, "field too wide");
577 
578 private:
579  friend class SelectionDAG;
580  // TODO: unfriend HandleSDNode once we fix its operand handling.
581  friend class HandleSDNode;
582 
583  /// Unique id per SDNode in the DAG.
584  int NodeId = -1;
585 
586  /// The values that are used by this operation.
587  SDUse *OperandList = nullptr;
588 
589  /// The types of the values this node defines. SDNode's may
590  /// define multiple values simultaneously.
591  const EVT *ValueList;
592 
593  /// List of uses for this SDNode.
594  SDUse *UseList = nullptr;
595 
596  /// The number of entries in the Operand/Value list.
597  unsigned short NumOperands = 0;
598  unsigned short NumValues;
599 
600  // The ordering of the SDNodes. It roughly corresponds to the ordering of the
601  // original LLVM instructions.
602  // This is used for turning off scheduling, because we'll forgo
603  // the normal scheduling algorithms and output the instructions according to
604  // this ordering.
605  unsigned IROrder;
606 
607  /// Source line information.
608  DebugLoc debugLoc;
609 
610  /// Return a pointer to the specified value type.
611  static const EVT *getValueTypeList(EVT VT);
612 
613  SDNodeFlags Flags;
614 
615 public:
616  /// Unique and persistent id per SDNode in the DAG.
617  /// Used for debug printing.
619 
620  //===--------------------------------------------------------------------===//
621  // Accessors
622  //
623 
624  /// Return the SelectionDAG opcode value for this node. For
625  /// pre-isel nodes (those for which isMachineOpcode returns false), these
626  /// are the opcode values in the ISD and <target>ISD namespaces. For
627  /// post-isel opcodes, see getMachineOpcode.
628  unsigned getOpcode() const { return (unsigned short)NodeType; }
629 
630  /// Test if this node has a target-specific opcode (in the
631  /// <target>ISD namespace).
632  bool isTargetOpcode() const { return NodeType >= ISD::BUILTIN_OP_END; }
633 
634  /// Test if this node has a target-specific opcode that may raise
635  /// FP exceptions (in the <target>ISD namespace and greater than
636  /// FIRST_TARGET_STRICTFP_OPCODE). Note that all target memory
637  /// opcode are currently automatically considered to possibly raise
638  /// FP exceptions as well.
639  bool isTargetStrictFPOpcode() const {
641  }
642 
643  /// Test if this node has a target-specific
644  /// memory-referencing opcode (in the <target>ISD namespace and
645  /// greater than FIRST_TARGET_MEMORY_OPCODE).
646  bool isTargetMemoryOpcode() const {
648  }
649 
650  /// Return true if the type of the node type undefined.
651  bool isUndef() const { return NodeType == ISD::UNDEF; }
652 
653  /// Test if this node is a memory intrinsic (with valid pointer information).
654  /// INTRINSIC_W_CHAIN and INTRINSIC_VOID nodes are sometimes created for
655  /// non-memory intrinsics (with chains) that are not really instances of
656  /// MemSDNode. For such nodes, we need some extra state to determine the
657  /// proper classof relationship.
658  bool isMemIntrinsic() const {
659  return (NodeType == ISD::INTRINSIC_W_CHAIN ||
661  SDNodeBits.IsMemIntrinsic;
662  }
663 
664  /// Test if this node is a strict floating point pseudo-op.
666  switch (NodeType) {
667  default:
668  return false;
671 #define DAG_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \
672  case ISD::STRICT_##DAGN:
673 #include "llvm/IR/ConstrainedOps.def"
674  return true;
675  }
676  }
677 
678  /// Test if this node is a vector predication operation.
679  bool isVPOpcode() const { return ISD::isVPOpcode(getOpcode()); }
680 
681  /// Test if this node has a post-isel opcode, directly
682  /// corresponding to a MachineInstr opcode.
683  bool isMachineOpcode() const { return NodeType < 0; }
684 
685  /// This may only be called if isMachineOpcode returns
686  /// true. It returns the MachineInstr opcode value that the node's opcode
687  /// corresponds to.
688  unsigned getMachineOpcode() const {
689  assert(isMachineOpcode() && "Not a MachineInstr opcode!");
690  return ~NodeType;
691  }
692 
693  bool getHasDebugValue() const { return SDNodeBits.HasDebugValue; }
694  void setHasDebugValue(bool b) { SDNodeBits.HasDebugValue = b; }
695 
696  bool isDivergent() const { return SDNodeBits.IsDivergent; }
697 
698  /// Return true if there are no uses of this node.
699  bool use_empty() const { return UseList == nullptr; }
700 
701  /// Return true if there is exactly one use of this node.
702  bool hasOneUse() const { return hasSingleElement(uses()); }
703 
704  /// Return the number of uses of this node. This method takes
705  /// time proportional to the number of uses.
706  size_t use_size() const { return std::distance(use_begin(), use_end()); }
707 
708  /// Return the unique node id.
709  int getNodeId() const { return NodeId; }
710 
711  /// Set unique node id.
712  void setNodeId(int Id) { NodeId = Id; }
713 
714  /// Return the node ordering.
715  unsigned getIROrder() const { return IROrder; }
716 
717  /// Set the node ordering.
718  void setIROrder(unsigned Order) { IROrder = Order; }
719 
720  /// Return the source location info.
721  const DebugLoc &getDebugLoc() const { return debugLoc; }
722 
723  /// Set source location info. Try to avoid this, putting
724  /// it in the constructor is preferable.
725  void setDebugLoc(DebugLoc dl) { debugLoc = std::move(dl); }
726 
727  /// This class provides iterator support for SDUse
728  /// operands that use a specific SDNode.
729  class use_iterator {
730  friend class SDNode;
731 
732  SDUse *Op = nullptr;
733 
734  explicit use_iterator(SDUse *op) : Op(op) {}
735 
736  public:
737  using iterator_category = std::forward_iterator_tag;
738  using value_type = SDUse;
739  using difference_type = std::ptrdiff_t;
740  using pointer = value_type *;
742 
743  use_iterator() = default;
745 
746  bool operator==(const use_iterator &x) const {
747  return Op == x.Op;
748  }
749  bool operator!=(const use_iterator &x) const {
750  return !operator==(x);
751  }
752 
753  /// Return true if this iterator is at the end of uses list.
754  bool atEnd() const { return Op == nullptr; }
755 
756  // Iterator traversal: forward iteration only.
757  use_iterator &operator++() { // Preincrement
758  assert(Op && "Cannot increment end iterator!");
759  Op = Op->getNext();
760  return *this;
761  }
762 
763  use_iterator operator++(int) { // Postincrement
764  use_iterator tmp = *this; ++*this; return tmp;
765  }
766 
767  /// Retrieve a pointer to the current user node.
768  SDNode *operator*() const {
769  assert(Op && "Cannot dereference end iterator!");
770  return Op->getUser();
771  }
772 
773  SDNode *operator->() const { return operator*(); }
774 
775  SDUse &getUse() const { return *Op; }
776 
777  /// Retrieve the operand # of this use in its user.
778  unsigned getOperandNo() const {
779  assert(Op && "Cannot dereference end iterator!");
780  return (unsigned)(Op - Op->getUser()->OperandList);
781  }
782  };
783 
784  /// Provide iteration support to walk over all uses of an SDNode.
786  return use_iterator(UseList);
787  }
788 
789  static use_iterator use_end() { return use_iterator(nullptr); }
790 
792  return make_range(use_begin(), use_end());
793  }
795  return make_range(use_begin(), use_end());
796  }
797 
798  /// Return true if there are exactly NUSES uses of the indicated value.
799  /// This method ignores uses of other values defined by this operation.
800  bool hasNUsesOfValue(unsigned NUses, unsigned Value) const;
801 
802  /// Return true if there are any use of the indicated value.
803  /// This method ignores uses of other values defined by this operation.
804  bool hasAnyUseOfValue(unsigned Value) const;
805 
806  /// Return true if this node is the only use of N.
807  bool isOnlyUserOf(const SDNode *N) const;
808 
809  /// Return true if this node is an operand of N.
810  bool isOperandOf(const SDNode *N) const;
811 
812  /// Return true if this node is a predecessor of N.
813  /// NOTE: Implemented on top of hasPredecessor and every bit as
814  /// expensive. Use carefully.
815  bool isPredecessorOf(const SDNode *N) const {
816  return N->hasPredecessor(this);
817  }
818 
819  /// Return true if N is a predecessor of this node.
820  /// N is either an operand of this node, or can be reached by recursively
821  /// traversing up the operands.
822  /// NOTE: This is an expensive method. Use it carefully.
823  bool hasPredecessor(const SDNode *N) const;
824 
825  /// Returns true if N is a predecessor of any node in Worklist. This
826  /// helper keeps Visited and Worklist sets externally to allow unions
827  /// searches to be performed in parallel, caching of results across
828  /// queries and incremental addition to Worklist. Stops early if N is
829  /// found but will resume. Remember to clear Visited and Worklists
830  /// if DAG changes. MaxSteps gives a maximum number of nodes to visit before
831  /// giving up. The TopologicalPrune flag signals that positive NodeIds are
832  /// topologically ordered (Operands have strictly smaller node id) and search
833  /// can be pruned leveraging this.
834  static bool hasPredecessorHelper(const SDNode *N,
837  unsigned int MaxSteps = 0,
838  bool TopologicalPrune = false) {
839  SmallVector<const SDNode *, 8> DeferredNodes;
840  if (Visited.count(N))
841  return true;
842 
843  // Node Id's are assigned in three places: As a topological
844  // ordering (> 0), during legalization (results in values set to
845  // 0), new nodes (set to -1). If N has a topolgical id then we
846  // know that all nodes with ids smaller than it cannot be
847  // successors and we need not check them. Filter out all node
848  // that can't be matches. We add them to the worklist before exit
849  // in case of multiple calls. Note that during selection the topological id
850  // may be violated if a node's predecessor is selected before it. We mark
851  // this at selection negating the id of unselected successors and
852  // restricting topological pruning to positive ids.
853 
854  int NId = N->getNodeId();
855  // If we Invalidated the Id, reconstruct original NId.
856  if (NId < -1)
857  NId = -(NId + 1);
858 
859  bool Found = false;
860  while (!Worklist.empty()) {
861  const SDNode *M = Worklist.pop_back_val();
862  int MId = M->getNodeId();
863  if (TopologicalPrune && M->getOpcode() != ISD::TokenFactor && (NId > 0) &&
864  (MId > 0) && (MId < NId)) {
865  DeferredNodes.push_back(M);
866  continue;
867  }
868  for (const SDValue &OpV : M->op_values()) {
869  SDNode *Op = OpV.getNode();
870  if (Visited.insert(Op).second)
871  Worklist.push_back(Op);
872  if (Op == N)
873  Found = true;
874  }
875  if (Found)
876  break;
877  if (MaxSteps != 0 && Visited.size() >= MaxSteps)
878  break;
879  }
880  // Push deferred nodes back on worklist.
881  Worklist.append(DeferredNodes.begin(), DeferredNodes.end());
882  // If we bailed early, conservatively return found.
883  if (MaxSteps != 0 && Visited.size() >= MaxSteps)
884  return true;
885  return Found;
886  }
887 
888  /// Return true if all the users of N are contained in Nodes.
889  /// NOTE: Requires at least one match, but doesn't require them all.
890  static bool areOnlyUsersOf(ArrayRef<const SDNode *> Nodes, const SDNode *N);
891 
892  /// Return the number of values used by this operation.
893  unsigned getNumOperands() const { return NumOperands; }
894 
895  /// Return the maximum number of operands that a SDNode can hold.
896  static constexpr size_t getMaxNumOperands() {
897  return std::numeric_limits<decltype(SDNode::NumOperands)>::max();
898  }
899 
900  /// Helper method returns the integer value of a ConstantSDNode operand.
901  inline uint64_t getConstantOperandVal(unsigned Num) const;
902 
903  /// Helper method returns the APInt of a ConstantSDNode operand.
904  inline const APInt &getConstantOperandAPInt(unsigned Num) const;
905 
906  const SDValue &getOperand(unsigned Num) const {
907  assert(Num < NumOperands && "Invalid child # of SDNode!");
908  return OperandList[Num];
909  }
910 
911  using op_iterator = SDUse *;
912 
913  op_iterator op_begin() const { return OperandList; }
914  op_iterator op_end() const { return OperandList+NumOperands; }
915  ArrayRef<SDUse> ops() const { return makeArrayRef(op_begin(), op_end()); }
916 
917  /// Iterator for directly iterating over the operand SDValue's.
919  : iterator_adaptor_base<value_op_iterator, op_iterator,
920  std::random_access_iterator_tag, SDValue,
921  ptrdiff_t, value_op_iterator *,
922  value_op_iterator *> {
923  explicit value_op_iterator(SDUse *U = nullptr)
924  : iterator_adaptor_base(U) {}
925 
926  const SDValue &operator*() const { return I->get(); }
927  };
928 
932  }
933 
934  SDVTList getVTList() const {
935  SDVTList X = { ValueList, NumValues };
936  return X;
937  }
938 
939  /// If this node has a glue operand, return the node
940  /// to which the glue operand points. Otherwise return NULL.
941  SDNode *getGluedNode() const {
942  if (getNumOperands() != 0 &&
944  return getOperand(getNumOperands()-1).getNode();
945  return nullptr;
946  }
947 
948  /// If this node has a glue value with a user, return
949  /// the user (there is at most one). Otherwise return NULL.
950  SDNode *getGluedUser() const {
951  for (use_iterator UI = use_begin(), UE = use_end(); UI != UE; ++UI)
952  if (UI.getUse().get().getValueType() == MVT::Glue)
953  return *UI;
954  return nullptr;
955  }
956 
957  SDNodeFlags getFlags() const { return Flags; }
958  void setFlags(SDNodeFlags NewFlags) { Flags = NewFlags; }
959 
960  /// Clear any flags in this node that aren't also set in Flags.
961  /// If Flags is not in a defined state then this has no effect.
962  void intersectFlagsWith(const SDNodeFlags Flags);
963 
964  /// Return the number of values defined/returned by this operator.
965  unsigned getNumValues() const { return NumValues; }
966 
967  /// Return the type of a specified result.
968  EVT getValueType(unsigned ResNo) const {
969  assert(ResNo < NumValues && "Illegal result number!");
970  return ValueList[ResNo];
971  }
972 
973  /// Return the type of a specified result as a simple type.
974  MVT getSimpleValueType(unsigned ResNo) const {
975  return getValueType(ResNo).getSimpleVT();
976  }
977 
978  /// Returns MVT::getSizeInBits(getValueType(ResNo)).
979  ///
980  /// If the value type is a scalable vector type, the scalable property will
981  /// be set and the runtime size will be a positive integer multiple of the
982  /// base size.
983  TypeSize getValueSizeInBits(unsigned ResNo) const {
984  return getValueType(ResNo).getSizeInBits();
985  }
986 
987  using value_iterator = const EVT *;
988 
989  value_iterator value_begin() const { return ValueList; }
990  value_iterator value_end() const { return ValueList+NumValues; }
993  }
994 
995  /// Return the opcode of this operation for printing.
996  std::string getOperationName(const SelectionDAG *G = nullptr) const;
997  static const char* getIndexedModeName(ISD::MemIndexedMode AM);
998  void print_types(raw_ostream &OS, const SelectionDAG *G) const;
999  void print_details(raw_ostream &OS, const SelectionDAG *G) const;
1000  void print(raw_ostream &OS, const SelectionDAG *G = nullptr) const;
1001  void printr(raw_ostream &OS, const SelectionDAG *G = nullptr) const;
1002 
1003  /// Print a SelectionDAG node and all children down to
1004  /// the leaves. The given SelectionDAG allows target-specific nodes
1005  /// to be printed in human-readable form. Unlike printr, this will
1006  /// print the whole DAG, including children that appear multiple
1007  /// times.
1008  ///
1009  void printrFull(raw_ostream &O, const SelectionDAG *G = nullptr) const;
1010 
1011  /// Print a SelectionDAG node and children up to
1012  /// depth "depth." The given SelectionDAG allows target-specific
1013  /// nodes to be printed in human-readable form. Unlike printr, this
1014  /// will print children that appear multiple times wherever they are
1015  /// used.
1016  ///
1017  void printrWithDepth(raw_ostream &O, const SelectionDAG *G = nullptr,
1018  unsigned depth = 100) const;
1019 
1020  /// Dump this node, for debugging.
1021  void dump() const;
1022 
1023  /// Dump (recursively) this node and its use-def subgraph.
1024  void dumpr() const;
1025 
1026  /// Dump this node, for debugging.
1027  /// The given SelectionDAG allows target-specific nodes to be printed
1028  /// in human-readable form.
1029  void dump(const SelectionDAG *G) const;
1030 
1031  /// Dump (recursively) this node and its use-def subgraph.
1032  /// The given SelectionDAG allows target-specific nodes to be printed
1033  /// in human-readable form.
1034  void dumpr(const SelectionDAG *G) const;
1035 
1036  /// printrFull to dbgs(). The given SelectionDAG allows
1037  /// target-specific nodes to be printed in human-readable form.
1038  /// Unlike dumpr, this will print the whole DAG, including children
1039  /// that appear multiple times.
1040  void dumprFull(const SelectionDAG *G = nullptr) const;
1041 
1042  /// printrWithDepth to dbgs(). The given
1043  /// SelectionDAG allows target-specific nodes to be printed in
1044  /// human-readable form. Unlike dumpr, this will print children
1045  /// that appear multiple times wherever they are used.
1046  ///
1047  void dumprWithDepth(const SelectionDAG *G = nullptr,
1048  unsigned depth = 100) const;
1049 
1050  /// Gather unique data for the node.
1051  void Profile(FoldingSetNodeID &ID) const;
1052 
1053  /// This method should only be used by the SDUse class.
1054  void addUse(SDUse &U) { U.addToList(&UseList); }
1055 
1056 protected:
1057  static SDVTList getSDVTList(EVT VT) {
1058  SDVTList Ret = { getValueTypeList(VT), 1 };
1059  return Ret;
1060  }
1061 
1062  /// Create an SDNode.
1063  ///
1064  /// SDNodes are created without any operands, and never own the operand
1065  /// storage. To add operands, see SelectionDAG::createOperands.
1066  SDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs)
1067  : NodeType(Opc), ValueList(VTs.VTs), NumValues(VTs.NumVTs),
1068  IROrder(Order), debugLoc(std::move(dl)) {
1069  memset(&RawSDNodeBits, 0, sizeof(RawSDNodeBits));
1070  assert(debugLoc.hasTrivialDestructor() && "Expected trivial destructor");
1071  assert(NumValues == VTs.NumVTs &&
1072  "NumValues wasn't wide enough for its operands!");
1073  }
1074 
1075  /// Release the operands and set this node to have zero operands.
1076  void DropOperands();
1077 };
1078 
1079 /// Wrapper class for IR location info (IR ordering and DebugLoc) to be passed
1080 /// into SDNode creation functions.
1081 /// When an SDNode is created from the DAGBuilder, the DebugLoc is extracted
1082 /// from the original Instruction, and IROrder is the ordinal position of
1083 /// the instruction.
1084 /// When an SDNode is created after the DAG is being built, both DebugLoc and
1085 /// the IROrder are propagated from the original SDNode.
1086 /// So SDLoc class provides two constructors besides the default one, one to
1087 /// be used by the DAGBuilder, the other to be used by others.
1088 class SDLoc {
1089 private:
1090  DebugLoc DL;
1091  int IROrder = 0;
1092 
1093 public:
1094  SDLoc() = default;
1095  SDLoc(const SDNode *N) : DL(N->getDebugLoc()), IROrder(N->getIROrder()) {}
1096  SDLoc(const SDValue V) : SDLoc(V.getNode()) {}
1097  SDLoc(const Instruction *I, int Order) : IROrder(Order) {
1098  assert(Order >= 0 && "bad IROrder");
1099  if (I)
1100  DL = I->getDebugLoc();
1101  }
1102 
1103  unsigned getIROrder() const { return IROrder; }
1104  const DebugLoc &getDebugLoc() const { return DL; }
1105 };
1106 
1107 // Define inline functions from the SDValue class.
1108 
1109 inline SDValue::SDValue(SDNode *node, unsigned resno)
1110  : Node(node), ResNo(resno) {
1111  // Explicitly check for !ResNo to avoid use-after-free, because there are
1112  // callers that use SDValue(N, 0) with a deleted N to indicate successful
1113  // combines.
1114  assert((!Node || !ResNo || ResNo < Node->getNumValues()) &&
1115  "Invalid result number for the given node!");
1116  assert(ResNo < -2U && "Cannot use result numbers reserved for DenseMaps.");
1117 }
1118 
1119 inline unsigned SDValue::getOpcode() const {
1120  return Node->getOpcode();
1121 }
1122 
1123 inline EVT SDValue::getValueType() const {
1124  return Node->getValueType(ResNo);
1125 }
1126 
1127 inline unsigned SDValue::getNumOperands() const {
1128  return Node->getNumOperands();
1129 }
1130 
1131 inline const SDValue &SDValue::getOperand(unsigned i) const {
1132  return Node->getOperand(i);
1133 }
1134 
1136  return Node->getConstantOperandVal(i);
1137 }
1138 
1139 inline const APInt &SDValue::getConstantOperandAPInt(unsigned i) const {
1140  return Node->getConstantOperandAPInt(i);
1141 }
1142 
1143 inline bool SDValue::isTargetOpcode() const {
1144  return Node->isTargetOpcode();
1145 }
1146 
1147 inline bool SDValue::isTargetMemoryOpcode() const {
1148  return Node->isTargetMemoryOpcode();
1149 }
1150 
1151 inline bool SDValue::isMachineOpcode() const {
1152  return Node->isMachineOpcode();
1153 }
1154 
1155 inline unsigned SDValue::getMachineOpcode() const {
1156  return Node->getMachineOpcode();
1157 }
1158 
1159 inline bool SDValue::isUndef() const {
1160  return Node->isUndef();
1161 }
1162 
1163 inline bool SDValue::use_empty() const {
1164  return !Node->hasAnyUseOfValue(ResNo);
1165 }
1166 
1167 inline bool SDValue::hasOneUse() const {
1168  return Node->hasNUsesOfValue(1, ResNo);
1169 }
1170 
1171 inline const DebugLoc &SDValue::getDebugLoc() const {
1172  return Node->getDebugLoc();
1173 }
1174 
1175 inline void SDValue::dump() const {
1176  return Node->dump();
1177 }
1178 
1179 inline void SDValue::dump(const SelectionDAG *G) const {
1180  return Node->dump(G);
1181 }
1182 
1183 inline void SDValue::dumpr() const {
1184  return Node->dumpr();
1185 }
1186 
1187 inline void SDValue::dumpr(const SelectionDAG *G) const {
1188  return Node->dumpr(G);
1189 }
1190 
1191 // Define inline functions from the SDUse class.
1192 
1193 inline void SDUse::set(const SDValue &V) {
1194  if (Val.getNode()) removeFromList();
1195  Val = V;
1196  if (V.getNode()) V.getNode()->addUse(*this);
1197 }
1198 
1199 inline void SDUse::setInitial(const SDValue &V) {
1200  Val = V;
1201  V.getNode()->addUse(*this);
1202 }
1203 
1204 inline void SDUse::setNode(SDNode *N) {
1205  if (Val.getNode()) removeFromList();
1206  Val.setNode(N);
1207  if (N) N->addUse(*this);
1208 }
1209 
1210 /// This class is used to form a handle around another node that
1211 /// is persistent and is updated across invocations of replaceAllUsesWith on its
1212 /// operand. This node should be directly created by end-users and not added to
1213 /// the AllNodes list.
1214 class HandleSDNode : public SDNode {
1215  SDUse Op;
1216 
1217 public:
1219  : SDNode(ISD::HANDLENODE, 0, DebugLoc(), getSDVTList(MVT::Other)) {
1220  // HandleSDNodes are never inserted into the DAG, so they won't be
1221  // auto-numbered. Use ID 65535 as a sentinel.
1222  PersistentId = 0xffff;
1223 
1224  // Manually set up the operand list. This node type is special in that it's
1225  // always stack allocated and SelectionDAG does not manage its operands.
1226  // TODO: This should either (a) not be in the SDNode hierarchy, or (b) not
1227  // be so special.
1228  Op.setUser(this);
1229  Op.setInitial(X);
1230  NumOperands = 1;
1231  OperandList = &Op;
1232  }
1233  ~HandleSDNode();
1234 
1235  const SDValue &getValue() const { return Op; }
1236 };
1237 
1238 class AddrSpaceCastSDNode : public SDNode {
1239 private:
1240  unsigned SrcAddrSpace;
1241  unsigned DestAddrSpace;
1242 
1243 public:
1244  AddrSpaceCastSDNode(unsigned Order, const DebugLoc &dl, EVT VT,
1245  unsigned SrcAS, unsigned DestAS);
1246 
1247  unsigned getSrcAddressSpace() const { return SrcAddrSpace; }
1248  unsigned getDestAddressSpace() const { return DestAddrSpace; }
1249 
1250  static bool classof(const SDNode *N) {
1251  return N->getOpcode() == ISD::ADDRSPACECAST;
1252  }
1253 };
1254 
1255 /// This is an abstract virtual class for memory operations.
1256 class MemSDNode : public SDNode {
1257 private:
1258  // VT of in-memory value.
1259  EVT MemoryVT;
1260 
1261 protected:
1262  /// Memory reference information.
1264 
1265 public:
1266  MemSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTs,
1267  EVT memvt, MachineMemOperand *MMO);
1268 
1269  bool readMem() const { return MMO->isLoad(); }
1270  bool writeMem() const { return MMO->isStore(); }
1271 
1272  /// Returns alignment and volatility of the memory access
1273  Align getOriginalAlign() const { return MMO->getBaseAlign(); }
1274  Align getAlign() const { return MMO->getAlign(); }
1275  // FIXME: Remove once transition to getAlign is over.
1276  unsigned getAlignment() const { return MMO->getAlign().value(); }
1277 
1278  /// Return the SubclassData value, without HasDebugValue. This contains an
1279  /// encoding of the volatile flag, as well as bits used by subclasses. This
1280  /// function should only be used to compute a FoldingSetNodeID value.
1281  /// The HasDebugValue bit is masked out because CSE map needs to match
1282  /// nodes with debug info with nodes without debug info. Same is about
1283  /// isDivergent bit.
1284  unsigned getRawSubclassData() const {
1285  uint16_t Data;
1286  union {
1287  char RawSDNodeBits[sizeof(uint16_t)];
1289  };
1290  memcpy(&RawSDNodeBits, &this->RawSDNodeBits, sizeof(this->RawSDNodeBits));
1291  SDNodeBits.HasDebugValue = 0;
1292  SDNodeBits.IsDivergent = false;
1293  memcpy(&Data, &RawSDNodeBits, sizeof(RawSDNodeBits));
1294  return Data;
1295  }
1296 
1297  bool isVolatile() const { return MemSDNodeBits.IsVolatile; }
1298  bool isNonTemporal() const { return MemSDNodeBits.IsNonTemporal; }
1299  bool isDereferenceable() const { return MemSDNodeBits.IsDereferenceable; }
1300  bool isInvariant() const { return MemSDNodeBits.IsInvariant; }
1301 
1302  // Returns the offset from the location of the access.
1303  int64_t getSrcValueOffset() const { return MMO->getOffset(); }
1304 
1305  /// Returns the AA info that describes the dereference.
1306  AAMDNodes getAAInfo() const { return MMO->getAAInfo(); }
1307 
1308  /// Returns the Ranges that describes the dereference.
1309  const MDNode *getRanges() const { return MMO->getRanges(); }
1310 
1311  /// Returns the synchronization scope ID for this memory operation.
1313 
1314  /// Return the atomic ordering requirements for this memory operation. For
1315  /// cmpxchg atomic operations, return the atomic ordering requirements when
1316  /// store occurs.
1318  return MMO->getSuccessOrdering();
1319  }
1320 
1321  /// Return a single atomic ordering that is at least as strong as both the
1322  /// success and failure orderings for an atomic operation. (For operations
1323  /// other than cmpxchg, this is equivalent to getSuccessOrdering().)
1325 
1326  /// Return true if the memory operation ordering is Unordered or higher.
1327  bool isAtomic() const { return MMO->isAtomic(); }
1328 
1329  /// Returns true if the memory operation doesn't imply any ordering
1330  /// constraints on surrounding memory operations beyond the normal memory
1331  /// aliasing rules.
1332  bool isUnordered() const { return MMO->isUnordered(); }
1333 
1334  /// Returns true if the memory operation is neither atomic or volatile.
1335  bool isSimple() const { return !isAtomic() && !isVolatile(); }
1336 
1337  /// Return the type of the in-memory value.
1338  EVT getMemoryVT() const { return MemoryVT; }
1339 
1340  /// Return a MachineMemOperand object describing the memory
1341  /// reference performed by operation.
1342  MachineMemOperand *getMemOperand() const { return MMO; }
1343 
1345  return MMO->getPointerInfo();
1346  }
1347 
1348  /// Return the address space for the associated pointer
1349  unsigned getAddressSpace() const {
1350  return getPointerInfo().getAddrSpace();
1351  }
1352 
1353  /// Update this MemSDNode's MachineMemOperand information
1354  /// to reflect the alignment of NewMMO, if it has a greater alignment.
1355  /// This must only be used when the new alignment applies to all users of
1356  /// this MachineMemOperand.
1357  void refineAlignment(const MachineMemOperand *NewMMO) {
1358  MMO->refineAlignment(NewMMO);
1359  }
1360 
1361  const SDValue &getChain() const { return getOperand(0); }
1362 
1363  const SDValue &getBasePtr() const {
1364  switch (getOpcode()) {
1365  case ISD::STORE:
1366  case ISD::VP_STORE:
1367  case ISD::MSTORE:
1368  case ISD::VP_SCATTER:
1369  return getOperand(2);
1370  case ISD::MGATHER:
1371  case ISD::MSCATTER:
1372  return getOperand(3);
1373  default:
1374  return getOperand(1);
1375  }
1376  }
1377 
1378  // Methods to support isa and dyn_cast
1379  static bool classof(const SDNode *N) {
1380  // For some targets, we lower some target intrinsics to a MemIntrinsicNode
1381  // with either an intrinsic or a target opcode.
1382  switch (N->getOpcode()) {
1383  case ISD::LOAD:
1384  case ISD::STORE:
1385  case ISD::PREFETCH:
1386  case ISD::ATOMIC_CMP_SWAP:
1388  case ISD::ATOMIC_SWAP:
1389  case ISD::ATOMIC_LOAD_ADD:
1390  case ISD::ATOMIC_LOAD_SUB:
1391  case ISD::ATOMIC_LOAD_AND:
1392  case ISD::ATOMIC_LOAD_CLR:
1393  case ISD::ATOMIC_LOAD_OR:
1394  case ISD::ATOMIC_LOAD_XOR:
1395  case ISD::ATOMIC_LOAD_NAND:
1396  case ISD::ATOMIC_LOAD_MIN:
1397  case ISD::ATOMIC_LOAD_MAX:
1398  case ISD::ATOMIC_LOAD_UMIN:
1399  case ISD::ATOMIC_LOAD_UMAX:
1400  case ISD::ATOMIC_LOAD_FADD:
1401  case ISD::ATOMIC_LOAD_FSUB:
1402  case ISD::ATOMIC_LOAD:
1403  case ISD::ATOMIC_STORE:
1404  case ISD::MLOAD:
1405  case ISD::MSTORE:
1406  case ISD::MGATHER:
1407  case ISD::MSCATTER:
1408  case ISD::VP_LOAD:
1409  case ISD::VP_STORE:
1410  case ISD::VP_GATHER:
1411  case ISD::VP_SCATTER:
1412  return true;
1413  default:
1414  return N->isMemIntrinsic() || N->isTargetMemoryOpcode();
1415  }
1416  }
1417 };
1418 
1419 /// This is an SDNode representing atomic operations.
1420 class AtomicSDNode : public MemSDNode {
1421 public:
1422  AtomicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTL,
1423  EVT MemVT, MachineMemOperand *MMO)
1424  : MemSDNode(Opc, Order, dl, VTL, MemVT, MMO) {
1425  assert(((Opc != ISD::ATOMIC_LOAD && Opc != ISD::ATOMIC_STORE) ||
1426  MMO->isAtomic()) && "then why are we using an AtomicSDNode?");
1427  }
1428 
1429  const SDValue &getBasePtr() const { return getOperand(1); }
1430  const SDValue &getVal() const { return getOperand(2); }
1431 
1432  /// Returns true if this SDNode represents cmpxchg atomic operation, false
1433  /// otherwise.
1434  bool isCompareAndSwap() const {
1435  unsigned Op = getOpcode();
1436  return Op == ISD::ATOMIC_CMP_SWAP ||
1438  }
1439 
1440  /// For cmpxchg atomic operations, return the atomic ordering requirements
1441  /// when store does not occur.
1443  assert(isCompareAndSwap() && "Must be cmpxchg operation");
1444  return MMO->getFailureOrdering();
1445  }
1446 
1447  // Methods to support isa and dyn_cast
1448  static bool classof(const SDNode *N) {
1449  return N->getOpcode() == ISD::ATOMIC_CMP_SWAP ||
1450  N->getOpcode() == ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS ||
1451  N->getOpcode() == ISD::ATOMIC_SWAP ||
1452  N->getOpcode() == ISD::ATOMIC_LOAD_ADD ||
1453  N->getOpcode() == ISD::ATOMIC_LOAD_SUB ||
1454  N->getOpcode() == ISD::ATOMIC_LOAD_AND ||
1455  N->getOpcode() == ISD::ATOMIC_LOAD_CLR ||
1456  N->getOpcode() == ISD::ATOMIC_LOAD_OR ||
1457  N->getOpcode() == ISD::ATOMIC_LOAD_XOR ||
1458  N->getOpcode() == ISD::ATOMIC_LOAD_NAND ||
1459  N->getOpcode() == ISD::ATOMIC_LOAD_MIN ||
1460  N->getOpcode() == ISD::ATOMIC_LOAD_MAX ||
1461  N->getOpcode() == ISD::ATOMIC_LOAD_UMIN ||
1462  N->getOpcode() == ISD::ATOMIC_LOAD_UMAX ||
1463  N->getOpcode() == ISD::ATOMIC_LOAD_FADD ||
1464  N->getOpcode() == ISD::ATOMIC_LOAD_FSUB ||
1465  N->getOpcode() == ISD::ATOMIC_LOAD ||
1466  N->getOpcode() == ISD::ATOMIC_STORE;
1467  }
1468 };
1469 
1470 /// This SDNode is used for target intrinsics that touch
1471 /// memory and need an associated MachineMemOperand. Its opcode may be
1472 /// INTRINSIC_VOID, INTRINSIC_W_CHAIN, PREFETCH, or a target-specific opcode
1473 /// with a value not less than FIRST_TARGET_MEMORY_OPCODE.
1475 public:
1476  MemIntrinsicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl,
1477  SDVTList VTs, EVT MemoryVT, MachineMemOperand *MMO)
1478  : MemSDNode(Opc, Order, dl, VTs, MemoryVT, MMO) {
1479  SDNodeBits.IsMemIntrinsic = true;
1480  }
1481 
1482  // Methods to support isa and dyn_cast
1483  static bool classof(const SDNode *N) {
1484  // We lower some target intrinsics to their target opcode
1485  // early a node with a target opcode can be of this class
1486  return N->isMemIntrinsic() ||
1487  N->getOpcode() == ISD::PREFETCH ||
1488  N->isTargetMemoryOpcode();
1489  }
1490 };
1491 
1492 /// This SDNode is used to implement the code generator
1493 /// support for the llvm IR shufflevector instruction. It combines elements
1494 /// from two input vectors into a new input vector, with the selection and
1495 /// ordering of elements determined by an array of integers, referred to as
1496 /// the shuffle mask. For input vectors of width N, mask indices of 0..N-1
1497 /// refer to elements from the LHS input, and indices from N to 2N-1 the RHS.
1498 /// An index of -1 is treated as undef, such that the code generator may put
1499 /// any value in the corresponding element of the result.
1500 class ShuffleVectorSDNode : public SDNode {
1501  // The memory for Mask is owned by the SelectionDAG's OperandAllocator, and
1502  // is freed when the SelectionDAG object is destroyed.
1503  const int *Mask;
1504 
1505 protected:
1506  friend class SelectionDAG;
1507 
1508  ShuffleVectorSDNode(EVT VT, unsigned Order, const DebugLoc &dl, const int *M)
1509  : SDNode(ISD::VECTOR_SHUFFLE, Order, dl, getSDVTList(VT)), Mask(M) {}
1510 
1511 public:
1513  EVT VT = getValueType(0);
1514  return makeArrayRef(Mask, VT.getVectorNumElements());
1515  }
1516 
1517  int getMaskElt(unsigned Idx) const {
1518  assert(Idx < getValueType(0).getVectorNumElements() && "Idx out of range!");
1519  return Mask[Idx];
1520  }
1521 
1522  bool isSplat() const { return isSplatMask(Mask, getValueType(0)); }
1523 
1524  int getSplatIndex() const {
1525  assert(isSplat() && "Cannot get splat index for non-splat!");
1526  EVT VT = getValueType(0);
1527  for (unsigned i = 0, e = VT.getVectorNumElements(); i != e; ++i)
1528  if (Mask[i] >= 0)
1529  return Mask[i];
1530 
1531  // We can choose any index value here and be correct because all elements
1532  // are undefined. Return 0 for better potential for callers to simplify.
1533  return 0;
1534  }
1535 
1536  static bool isSplatMask(const int *Mask, EVT VT);
1537 
1538  /// Change values in a shuffle permute mask assuming
1539  /// the two vector operands have swapped position.
1541  unsigned NumElems = Mask.size();
1542  for (unsigned i = 0; i != NumElems; ++i) {
1543  int idx = Mask[i];
1544  if (idx < 0)
1545  continue;
1546  else if (idx < (int)NumElems)
1547  Mask[i] = idx + NumElems;
1548  else
1549  Mask[i] = idx - NumElems;
1550  }
1551  }
1552 
1553  static bool classof(const SDNode *N) {
1554  return N->getOpcode() == ISD::VECTOR_SHUFFLE;
1555  }
1556 };
1557 
1558 class ConstantSDNode : public SDNode {
1559  friend class SelectionDAG;
1560 
1561  const ConstantInt *Value;
1562 
1563  ConstantSDNode(bool isTarget, bool isOpaque, const ConstantInt *val, EVT VT)
1564  : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, 0, DebugLoc(),
1565  getSDVTList(VT)),
1566  Value(val) {
1567  ConstantSDNodeBits.IsOpaque = isOpaque;
1568  }
1569 
1570 public:
1571  const ConstantInt *getConstantIntValue() const { return Value; }
1572  const APInt &getAPIntValue() const { return Value->getValue(); }
1573  uint64_t getZExtValue() const { return Value->getZExtValue(); }
1574  int64_t getSExtValue() const { return Value->getSExtValue(); }
1576  return Value->getLimitedValue(Limit);
1577  }
1578  MaybeAlign getMaybeAlignValue() const { return Value->getMaybeAlignValue(); }
1579  Align getAlignValue() const { return Value->getAlignValue(); }
1580 
1581  bool isOne() const { return Value->isOne(); }
1582  bool isZero() const { return Value->isZero(); }
1583  // NOTE: This is soft-deprecated. Please use `isZero()` instead.
1584  bool isNullValue() const { return isZero(); }
1585  bool isAllOnes() const { return Value->isMinusOne(); }
1586  // NOTE: This is soft-deprecated. Please use `isAllOnes()` instead.
1587  bool isAllOnesValue() const { return isAllOnes(); }
1588  bool isMaxSignedValue() const { return Value->isMaxValue(true); }
1589  bool isMinSignedValue() const { return Value->isMinValue(true); }
1590 
1591  bool isOpaque() const { return ConstantSDNodeBits.IsOpaque; }
1592 
1593  static bool classof(const SDNode *N) {
1594  return N->getOpcode() == ISD::Constant ||
1595  N->getOpcode() == ISD::TargetConstant;
1596  }
1597 };
1598 
1600  return cast<ConstantSDNode>(getOperand(Num))->getZExtValue();
1601 }
1602 
1603 const APInt &SDNode::getConstantOperandAPInt(unsigned Num) const {
1604  return cast<ConstantSDNode>(getOperand(Num))->getAPIntValue();
1605 }
1606 
1607 class ConstantFPSDNode : public SDNode {
1608  friend class SelectionDAG;
1609 
1610  const ConstantFP *Value;
1611 
1612  ConstantFPSDNode(bool isTarget, const ConstantFP *val, EVT VT)
1613  : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP, 0,
1614  DebugLoc(), getSDVTList(VT)),
1615  Value(val) {}
1616 
1617 public:
1618  const APFloat& getValueAPF() const { return Value->getValueAPF(); }
1619  const ConstantFP *getConstantFPValue() const { return Value; }
1620 
1621  /// Return true if the value is positive or negative zero.
1622  bool isZero() const { return Value->isZero(); }
1623 
1624  /// Return true if the value is a NaN.
1625  bool isNaN() const { return Value->isNaN(); }
1626 
1627  /// Return true if the value is an infinity
1628  bool isInfinity() const { return Value->isInfinity(); }
1629 
1630  /// Return true if the value is negative.
1631  bool isNegative() const { return Value->isNegative(); }
1632 
1633  /// We don't rely on operator== working on double values, as
1634  /// it returns true for things that are clearly not equal, like -0.0 and 0.0.
1635  /// As such, this method can be used to do an exact bit-for-bit comparison of
1636  /// two floating point values.
1637 
1638  /// We leave the version with the double argument here because it's just so
1639  /// convenient to write "2.0" and the like. Without this function we'd
1640  /// have to duplicate its logic everywhere it's called.
1641  bool isExactlyValue(double V) const {
1642  return Value->getValueAPF().isExactlyValue(V);
1643  }
1644  bool isExactlyValue(const APFloat& V) const;
1645 
1646  static bool isValueValidForType(EVT VT, const APFloat& Val);
1647 
1648  static bool classof(const SDNode *N) {
1649  return N->getOpcode() == ISD::ConstantFP ||
1650  N->getOpcode() == ISD::TargetConstantFP;
1651  }
1652 };
1653 
1654 /// Returns true if \p V is a constant integer zero.
1655 bool isNullConstant(SDValue V);
1656 
1657 /// Returns true if \p V is an FP constant with a value of positive zero.
1658 bool isNullFPConstant(SDValue V);
1659 
1660 /// Returns true if \p V is an integer constant with all bits set.
1661 bool isAllOnesConstant(SDValue V);
1662 
1663 /// Returns true if \p V is a constant integer one.
1664 bool isOneConstant(SDValue V);
1665 
1666 /// Return the non-bitcasted source operand of \p V if it exists.
1667 /// If \p V is not a bitcasted value, it is returned as-is.
1668 SDValue peekThroughBitcasts(SDValue V);
1669 
1670 /// Return the non-bitcasted and one-use source operand of \p V if it exists.
1671 /// If \p V is not a bitcasted one-use value, it is returned as-is.
1672 SDValue peekThroughOneUseBitcasts(SDValue V);
1673 
1674 /// Return the non-extracted vector source operand of \p V if it exists.
1675 /// If \p V is not an extracted subvector, it is returned as-is.
1676 SDValue peekThroughExtractSubvectors(SDValue V);
1677 
1678 /// Returns true if \p V is a bitwise not operation. Assumes that an all ones
1679 /// constant is canonicalized to be operand 1.
1680 bool isBitwiseNot(SDValue V, bool AllowUndefs = false);
1681 
1682 /// Returns the SDNode if it is a constant splat BuildVector or constant int.
1683 ConstantSDNode *isConstOrConstSplat(SDValue N, bool AllowUndefs = false,
1684  bool AllowTruncation = false);
1685 
1686 /// Returns the SDNode if it is a demanded constant splat BuildVector or
1687 /// constant int.
1688 ConstantSDNode *isConstOrConstSplat(SDValue N, const APInt &DemandedElts,
1689  bool AllowUndefs = false,
1690  bool AllowTruncation = false);
1691 
1692 /// Returns the SDNode if it is a constant splat BuildVector or constant float.
1693 ConstantFPSDNode *isConstOrConstSplatFP(SDValue N, bool AllowUndefs = false);
1694 
1695 /// Returns the SDNode if it is a demanded constant splat BuildVector or
1696 /// constant float.
1697 ConstantFPSDNode *isConstOrConstSplatFP(SDValue N, const APInt &DemandedElts,
1698  bool AllowUndefs = false);
1699 
1700 /// Return true if the value is a constant 0 integer or a splatted vector of
1701 /// a constant 0 integer (with no undefs by default).
1702 /// Build vector implicit truncation is not an issue for null values.
1703 bool isNullOrNullSplat(SDValue V, bool AllowUndefs = false);
1704 
1705 /// Return true if the value is a constant 1 integer or a splatted vector of a
1706 /// constant 1 integer (with no undefs).
1707 /// Does not permit build vector implicit truncation.
1708 bool isOneOrOneSplat(SDValue V, bool AllowUndefs = false);
1709 
1710 /// Return true if the value is a constant -1 integer or a splatted vector of a
1711 /// constant -1 integer (with no undefs).
1712 /// Does not permit build vector implicit truncation.
1713 bool isAllOnesOrAllOnesSplat(SDValue V, bool AllowUndefs = false);
1714 
1715 /// Return true if \p V is either a integer or FP constant.
1716 inline bool isIntOrFPConstant(SDValue V) {
1717  return isa<ConstantSDNode>(V) || isa<ConstantFPSDNode>(V);
1718 }
1719 
1720 class GlobalAddressSDNode : public SDNode {
1721  friend class SelectionDAG;
1722 
1723  const GlobalValue *TheGlobal;
1724  int64_t Offset;
1725  unsigned TargetFlags;
1726 
1727  GlobalAddressSDNode(unsigned Opc, unsigned Order, const DebugLoc &DL,
1728  const GlobalValue *GA, EVT VT, int64_t o,
1729  unsigned TF);
1730 
1731 public:
1732  const GlobalValue *getGlobal() const { return TheGlobal; }
1733  int64_t getOffset() const { return Offset; }
1734  unsigned getTargetFlags() const { return TargetFlags; }
1735  // Return the address space this GlobalAddress belongs to.
1736  unsigned getAddressSpace() const;
1737 
1738  static bool classof(const SDNode *N) {
1739  return N->getOpcode() == ISD::GlobalAddress ||
1740  N->getOpcode() == ISD::TargetGlobalAddress ||
1741  N->getOpcode() == ISD::GlobalTLSAddress ||
1742  N->getOpcode() == ISD::TargetGlobalTLSAddress;
1743  }
1744 };
1745 
1746 class FrameIndexSDNode : public SDNode {
1747  friend class SelectionDAG;
1748 
1749  int FI;
1750 
1751  FrameIndexSDNode(int fi, EVT VT, bool isTarg)
1752  : SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex,
1753  0, DebugLoc(), getSDVTList(VT)), FI(fi) {
1754  }
1755 
1756 public:
1757  int getIndex() const { return FI; }
1758 
1759  static bool classof(const SDNode *N) {
1760  return N->getOpcode() == ISD::FrameIndex ||
1761  N->getOpcode() == ISD::TargetFrameIndex;
1762  }
1763 };
1764 
1765 /// This SDNode is used for LIFETIME_START/LIFETIME_END values, which indicate
1766 /// the offet and size that are started/ended in the underlying FrameIndex.
1767 class LifetimeSDNode : public SDNode {
1768  friend class SelectionDAG;
1769  int64_t Size;
1770  int64_t Offset; // -1 if offset is unknown.
1771 
1772  LifetimeSDNode(unsigned Opcode, unsigned Order, const DebugLoc &dl,
1773  SDVTList VTs, int64_t Size, int64_t Offset)
1774  : SDNode(Opcode, Order, dl, VTs), Size(Size), Offset(Offset) {}
1775 public:
1776  int64_t getFrameIndex() const {
1777  return cast<FrameIndexSDNode>(getOperand(1))->getIndex();
1778  }
1779 
1780  bool hasOffset() const { return Offset >= 0; }
1781  int64_t getOffset() const {
1782  assert(hasOffset() && "offset is unknown");
1783  return Offset;
1784  }
1785  int64_t getSize() const {
1786  assert(hasOffset() && "offset is unknown");
1787  return Size;
1788  }
1789 
1790  // Methods to support isa and dyn_cast
1791  static bool classof(const SDNode *N) {
1792  return N->getOpcode() == ISD::LIFETIME_START ||
1793  N->getOpcode() == ISD::LIFETIME_END;
1794  }
1795 };
1796 
1797 /// This SDNode is used for PSEUDO_PROBE values, which are the function guid and
1798 /// the index of the basic block being probed. A pseudo probe serves as a place
1799 /// holder and will be removed at the end of compilation. It does not have any
1800 /// operand because we do not want the instruction selection to deal with any.
1801 class PseudoProbeSDNode : public SDNode {
1802  friend class SelectionDAG;
1803  uint64_t Guid;
1804  uint64_t Index;
1806 
1807  PseudoProbeSDNode(unsigned Opcode, unsigned Order, const DebugLoc &Dl,
1808  SDVTList VTs, uint64_t Guid, uint64_t Index, uint32_t Attr)
1809  : SDNode(Opcode, Order, Dl, VTs), Guid(Guid), Index(Index),
1810  Attributes(Attr) {}
1811 
1812 public:
1813  uint64_t getGuid() const { return Guid; }
1814  uint64_t getIndex() const { return Index; }
1815  uint32_t getAttributes() const { return Attributes; }
1816 
1817  // Methods to support isa and dyn_cast
1818  static bool classof(const SDNode *N) {
1819  return N->getOpcode() == ISD::PSEUDO_PROBE;
1820  }
1821 };
1822 
1823 class JumpTableSDNode : public SDNode {
1824  friend class SelectionDAG;
1825 
1826  int JTI;
1827  unsigned TargetFlags;
1828 
1829  JumpTableSDNode(int jti, EVT VT, bool isTarg, unsigned TF)
1830  : SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable,
1831  0, DebugLoc(), getSDVTList(VT)), JTI(jti), TargetFlags(TF) {
1832  }
1833 
1834 public:
1835  int getIndex() const { return JTI; }
1836  unsigned getTargetFlags() const { return TargetFlags; }
1837 
1838  static bool classof(const SDNode *N) {
1839  return N->getOpcode() == ISD::JumpTable ||
1840  N->getOpcode() == ISD::TargetJumpTable;
1841  }
1842 };
1843 
1844 class ConstantPoolSDNode : public SDNode {
1845  friend class SelectionDAG;
1846 
1847  union {
1850  } Val;
1851  int Offset; // It's a MachineConstantPoolValue if top bit is set.
1852  Align Alignment; // Minimum alignment requirement of CP.
1853  unsigned TargetFlags;
1854 
1855  ConstantPoolSDNode(bool isTarget, const Constant *c, EVT VT, int o,
1856  Align Alignment, unsigned TF)
1857  : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 0,
1858  DebugLoc(), getSDVTList(VT)),
1859  Offset(o), Alignment(Alignment), TargetFlags(TF) {
1860  assert(Offset >= 0 && "Offset is too large");
1861  Val.ConstVal = c;
1862  }
1863 
1864  ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v, EVT VT, int o,
1865  Align Alignment, unsigned TF)
1866  : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 0,
1867  DebugLoc(), getSDVTList(VT)),
1868  Offset(o), Alignment(Alignment), TargetFlags(TF) {
1869  assert(Offset >= 0 && "Offset is too large");
1870  Val.MachineCPVal = v;
1871  Offset |= 1 << (sizeof(unsigned)*CHAR_BIT-1);
1872  }
1873 
1874 public:
1876  return Offset < 0;
1877  }
1878 
1879  const Constant *getConstVal() const {
1880  assert(!isMachineConstantPoolEntry() && "Wrong constantpool type");
1881  return Val.ConstVal;
1882  }
1883 
1885  assert(isMachineConstantPoolEntry() && "Wrong constantpool type");
1886  return Val.MachineCPVal;
1887  }
1888 
1889  int getOffset() const {
1890  return Offset & ~(1 << (sizeof(unsigned)*CHAR_BIT-1));
1891  }
1892 
1893  // Return the alignment of this constant pool object, which is either 0 (for
1894  // default alignment) or the desired value.
1895  Align getAlign() const { return Alignment; }
1896  unsigned getTargetFlags() const { return TargetFlags; }
1897 
1898  Type *getType() const;
1899 
1900  static bool classof(const SDNode *N) {
1901  return N->getOpcode() == ISD::ConstantPool ||
1902  N->getOpcode() == ISD::TargetConstantPool;
1903  }
1904 };
1905 
1906 /// Completely target-dependent object reference.
1907 class TargetIndexSDNode : public SDNode {
1908  friend class SelectionDAG;
1909 
1910  unsigned TargetFlags;
1911  int Index;
1912  int64_t Offset;
1913 
1914 public:
1915  TargetIndexSDNode(int Idx, EVT VT, int64_t Ofs, unsigned TF)
1916  : SDNode(ISD::TargetIndex, 0, DebugLoc(), getSDVTList(VT)),
1917  TargetFlags(TF), Index(Idx), Offset(Ofs) {}
1918 
1919  unsigned getTargetFlags() const { return TargetFlags; }
1920  int getIndex() const { return Index; }
1921  int64_t getOffset() const { return Offset; }
1922 
1923  static bool classof(const SDNode *N) {
1924  return N->getOpcode() == ISD::TargetIndex;
1925  }
1926 };
1927 
1928 class BasicBlockSDNode : public SDNode {
1929  friend class SelectionDAG;
1930 
1932 
1933  /// Debug info is meaningful and potentially useful here, but we create
1934  /// blocks out of order when they're jumped to, which makes it a bit
1935  /// harder. Let's see if we need it first.
1936  explicit BasicBlockSDNode(MachineBasicBlock *mbb)
1937  : SDNode(ISD::BasicBlock, 0, DebugLoc(), getSDVTList(MVT::Other)), MBB(mbb)
1938  {}
1939 
1940 public:
1941  MachineBasicBlock *getBasicBlock() const { return MBB; }
1942 
1943  static bool classof(const SDNode *N) {
1944  return N->getOpcode() == ISD::BasicBlock;
1945  }
1946 };
1947 
1948 /// A "pseudo-class" with methods for operating on BUILD_VECTORs.
1949 class BuildVectorSDNode : public SDNode {
1950 public:
1951  // These are constructed as SDNodes and then cast to BuildVectorSDNodes.
1952  explicit BuildVectorSDNode() = delete;
1953 
1954  /// Check if this is a constant splat, and if so, find the
1955  /// smallest element size that splats the vector. If MinSplatBits is
1956  /// nonzero, the element size must be at least that large. Note that the
1957  /// splat element may be the entire vector (i.e., a one element vector).
1958  /// Returns the splat element value in SplatValue. Any undefined bits in
1959  /// that value are zero, and the corresponding bits in the SplatUndef mask
1960  /// are set. The SplatBitSize value is set to the splat element size in
1961  /// bits. HasAnyUndefs is set to true if any bits in the vector are
1962  /// undefined. isBigEndian describes the endianness of the target.
1963  bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef,
1964  unsigned &SplatBitSize, bool &HasAnyUndefs,
1965  unsigned MinSplatBits = 0,
1966  bool isBigEndian = false) const;
1967 
1968  /// Returns the demanded splatted value or a null value if this is not a
1969  /// splat.
1970  ///
1971  /// The DemandedElts mask indicates the elements that must be in the splat.
1972  /// If passed a non-null UndefElements bitvector, it will resize it to match
1973  /// the vector width and set the bits where elements are undef.
1974  SDValue getSplatValue(const APInt &DemandedElts,
1975  BitVector *UndefElements = nullptr) const;
1976 
1977  /// Returns the splatted value or a null value if this is not a splat.
1978  ///
1979  /// If passed a non-null UndefElements bitvector, it will resize it to match
1980  /// the vector width and set the bits where elements are undef.
1981  SDValue getSplatValue(BitVector *UndefElements = nullptr) const;
1982 
1983  /// Find the shortest repeating sequence of values in the build vector.
1984  ///
1985  /// e.g. { u, X, u, X, u, u, X, u } -> { X }
1986  /// { X, Y, u, Y, u, u, X, u } -> { X, Y }
1987  ///
1988  /// Currently this must be a power-of-2 build vector.
1989  /// The DemandedElts mask indicates the elements that must be present,
1990  /// undemanded elements in Sequence may be null (SDValue()). If passed a
1991  /// non-null UndefElements bitvector, it will resize it to match the original
1992  /// vector width and set the bits where elements are undef. If result is
1993  /// false, Sequence will be empty.
1994  bool getRepeatedSequence(const APInt &DemandedElts,
1996  BitVector *UndefElements = nullptr) const;
1997 
1998  /// Find the shortest repeating sequence of values in the build vector.
1999  ///
2000  /// e.g. { u, X, u, X, u, u, X, u } -> { X }
2001  /// { X, Y, u, Y, u, u, X, u } -> { X, Y }
2002  ///
2003  /// Currently this must be a power-of-2 build vector.
2004  /// If passed a non-null UndefElements bitvector, it will resize it to match
2005  /// the original vector width and set the bits where elements are undef.
2006  /// If result is false, Sequence will be empty.
2008  BitVector *UndefElements = nullptr) const;
2009 
2010  /// Returns the demanded splatted constant or null if this is not a constant
2011  /// splat.
2012  ///
2013  /// The DemandedElts mask indicates the elements that must be in the splat.
2014  /// If passed a non-null UndefElements bitvector, it will resize it to match
2015  /// the vector width and set the bits where elements are undef.
2016  ConstantSDNode *
2017  getConstantSplatNode(const APInt &DemandedElts,
2018  BitVector *UndefElements = nullptr) const;
2019 
2020  /// Returns the splatted constant or null if this is not a constant
2021  /// splat.
2022  ///
2023  /// If passed a non-null UndefElements bitvector, it will resize it to match
2024  /// the vector width and set the bits where elements are undef.
2025  ConstantSDNode *
2026  getConstantSplatNode(BitVector *UndefElements = nullptr) const;
2027 
2028  /// Returns the demanded splatted constant FP or null if this is not a
2029  /// constant FP splat.
2030  ///
2031  /// The DemandedElts mask indicates the elements that must be in the splat.
2032  /// If passed a non-null UndefElements bitvector, it will resize it to match
2033  /// the vector width and set the bits where elements are undef.
2035  getConstantFPSplatNode(const APInt &DemandedElts,
2036  BitVector *UndefElements = nullptr) const;
2037 
2038  /// Returns the splatted constant FP or null if this is not a constant
2039  /// FP splat.
2040  ///
2041  /// If passed a non-null UndefElements bitvector, it will resize it to match
2042  /// the vector width and set the bits where elements are undef.
2044  getConstantFPSplatNode(BitVector *UndefElements = nullptr) const;
2045 
2046  /// If this is a constant FP splat and the splatted constant FP is an
2047  /// exact power or 2, return the log base 2 integer value. Otherwise,
2048  /// return -1.
2049  ///
2050  /// The BitWidth specifies the necessary bit precision.
2051  int32_t getConstantFPSplatPow2ToLog2Int(BitVector *UndefElements,
2052  uint32_t BitWidth) const;
2053 
2054  /// Extract the raw bit data from a build vector of Undef, Constant or
2055  /// ConstantFP node elements. Each raw bit element will be \p
2056  /// DstEltSizeInBits wide, undef elements are treated as zero, and entirely
2057  /// undefined elements are flagged in \p UndefElements.
2058  bool getConstantRawBits(bool IsLittleEndian, unsigned DstEltSizeInBits,
2059  SmallVectorImpl<APInt> &RawBitElements,
2060  BitVector &UndefElements) const;
2061 
2062  bool isConstant() const;
2063 
2064  /// Recast bit data \p SrcBitElements to \p DstEltSizeInBits wide elements.
2065  /// Undef elements are treated as zero, and entirely undefined elements are
2066  /// flagged in \p DstUndefElements.
2067  static void recastRawBits(bool IsLittleEndian, unsigned DstEltSizeInBits,
2068  SmallVectorImpl<APInt> &DstBitElements,
2069  ArrayRef<APInt> SrcBitElements,
2070  BitVector &DstUndefElements,
2071  const BitVector &SrcUndefElements);
2072 
2073  static bool classof(const SDNode *N) {
2074  return N->getOpcode() == ISD::BUILD_VECTOR;
2075  }
2076 };
2077 
2078 /// An SDNode that holds an arbitrary LLVM IR Value. This is
2079 /// used when the SelectionDAG needs to make a simple reference to something
2080 /// in the LLVM IR representation.
2081 ///
2082 class SrcValueSDNode : public SDNode {
2083  friend class SelectionDAG;
2084 
2085  const Value *V;
2086 
2087  /// Create a SrcValue for a general value.
2088  explicit SrcValueSDNode(const Value *v)
2089  : SDNode(ISD::SRCVALUE, 0, DebugLoc(), getSDVTList(MVT::Other)), V(v) {}
2090 
2091 public:
2092  /// Return the contained Value.
2093  const Value *getValue() const { return V; }
2094 
2095  static bool classof(const SDNode *N) {
2096  return N->getOpcode() == ISD::SRCVALUE;
2097  }
2098 };
2099 
2100 class MDNodeSDNode : public SDNode {
2101  friend class SelectionDAG;
2102 
2103  const MDNode *MD;
2104 
2105  explicit MDNodeSDNode(const MDNode *md)
2106  : SDNode(ISD::MDNODE_SDNODE, 0, DebugLoc(), getSDVTList(MVT::Other)), MD(md)
2107  {}
2108 
2109 public:
2110  const MDNode *getMD() const { return MD; }
2111 
2112  static bool classof(const SDNode *N) {
2113  return N->getOpcode() == ISD::MDNODE_SDNODE;
2114  }
2115 };
2116 
2117 class RegisterSDNode : public SDNode {
2118  friend class SelectionDAG;
2119 
2120  Register Reg;
2121 
2122  RegisterSDNode(Register reg, EVT VT)
2123  : SDNode(ISD::Register, 0, DebugLoc(), getSDVTList(VT)), Reg(reg) {}
2124 
2125 public:
2126  Register getReg() const { return Reg; }
2127 
2128  static bool classof(const SDNode *N) {
2129  return N->getOpcode() == ISD::Register;
2130  }
2131 };
2132 
2133 class RegisterMaskSDNode : public SDNode {
2134  friend class SelectionDAG;
2135 
2136  // The memory for RegMask is not owned by the node.
2137  const uint32_t *RegMask;
2138 
2139  RegisterMaskSDNode(const uint32_t *mask)
2141  RegMask(mask) {}
2142 
2143 public:
2144  const uint32_t *getRegMask() const { return RegMask; }
2145 
2146  static bool classof(const SDNode *N) {
2147  return N->getOpcode() == ISD::RegisterMask;
2148  }
2149 };
2150 
2151 class BlockAddressSDNode : public SDNode {
2152  friend class SelectionDAG;
2153 
2154  const BlockAddress *BA;
2155  int64_t Offset;
2156  unsigned TargetFlags;
2157 
2158  BlockAddressSDNode(unsigned NodeTy, EVT VT, const BlockAddress *ba,
2159  int64_t o, unsigned Flags)
2160  : SDNode(NodeTy, 0, DebugLoc(), getSDVTList(VT)),
2161  BA(ba), Offset(o), TargetFlags(Flags) {}
2162 
2163 public:
2164  const BlockAddress *getBlockAddress() const { return BA; }
2165  int64_t getOffset() const { return Offset; }
2166  unsigned getTargetFlags() const { return TargetFlags; }
2167 
2168  static bool classof(const SDNode *N) {
2169  return N->getOpcode() == ISD::BlockAddress ||
2170  N->getOpcode() == ISD::TargetBlockAddress;
2171  }
2172 };
2173 
2174 class LabelSDNode : public SDNode {
2175  friend class SelectionDAG;
2176 
2177  MCSymbol *Label;
2178 
2179  LabelSDNode(unsigned Opcode, unsigned Order, const DebugLoc &dl, MCSymbol *L)
2180  : SDNode(Opcode, Order, dl, getSDVTList(MVT::Other)), Label(L) {
2181  assert(LabelSDNode::classof(this) && "not a label opcode");
2182  }
2183 
2184 public:
2185  MCSymbol *getLabel() const { return Label; }
2186 
2187  static bool classof(const SDNode *N) {
2188  return N->getOpcode() == ISD::EH_LABEL ||
2189  N->getOpcode() == ISD::ANNOTATION_LABEL;
2190  }
2191 };
2192 
2194  friend class SelectionDAG;
2195 
2196  const char *Symbol;
2197  unsigned TargetFlags;
2198 
2199  ExternalSymbolSDNode(bool isTarget, const char *Sym, unsigned TF, EVT VT)
2200  : SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol, 0,
2201  DebugLoc(), getSDVTList(VT)),
2202  Symbol(Sym), TargetFlags(TF) {}
2203 
2204 public:
2205  const char *getSymbol() const { return Symbol; }
2206  unsigned getTargetFlags() const { return TargetFlags; }
2207 
2208  static bool classof(const SDNode *N) {
2209  return N->getOpcode() == ISD::ExternalSymbol ||
2210  N->getOpcode() == ISD::TargetExternalSymbol;
2211  }
2212 };
2213 
2214 class MCSymbolSDNode : public SDNode {
2215  friend class SelectionDAG;
2216 
2217  MCSymbol *Symbol;
2218 
2220  : SDNode(ISD::MCSymbol, 0, DebugLoc(), getSDVTList(VT)), Symbol(Symbol) {}
2221 
2222 public:
2223  MCSymbol *getMCSymbol() const { return Symbol; }
2224 
2225  static bool classof(const SDNode *N) {
2226  return N->getOpcode() == ISD::MCSymbol;
2227  }
2228 };
2229 
2230 class CondCodeSDNode : public SDNode {
2231  friend class SelectionDAG;
2232 
2233  ISD::CondCode Condition;
2234 
2236  : SDNode(ISD::CONDCODE, 0, DebugLoc(), getSDVTList(MVT::Other)),
2237  Condition(Cond) {}
2238 
2239 public:
2240  ISD::CondCode get() const { return Condition; }
2241 
2242  static bool classof(const SDNode *N) {
2243  return N->getOpcode() == ISD::CONDCODE;
2244  }
2245 };
2246 
2247 /// This class is used to represent EVT's, which are used
2248 /// to parameterize some operations.
2249 class VTSDNode : public SDNode {
2250  friend class SelectionDAG;
2251 
2252  EVT ValueType;
2253 
2254  explicit VTSDNode(EVT VT)
2255  : SDNode(ISD::VALUETYPE, 0, DebugLoc(), getSDVTList(MVT::Other)),
2256  ValueType(VT) {}
2257 
2258 public:
2259  EVT getVT() const { return ValueType; }
2260 
2261  static bool classof(const SDNode *N) {
2262  return N->getOpcode() == ISD::VALUETYPE;
2263  }
2264 };
2265 
2266 /// Base class for LoadSDNode and StoreSDNode
2267 class LSBaseSDNode : public MemSDNode {
2268 public:
2269  LSBaseSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl,
2270  SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT,
2272  : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2273  LSBaseSDNodeBits.AddressingMode = AM;
2274  assert(getAddressingMode() == AM && "Value truncated");
2275  }
2276 
2277  const SDValue &getOffset() const {
2278  return getOperand(getOpcode() == ISD::LOAD ? 2 : 3);
2279  }
2280 
2281  /// Return the addressing mode for this load or store:
2282  /// unindexed, pre-inc, pre-dec, post-inc, or post-dec.
2284  return static_cast<ISD::MemIndexedMode>(LSBaseSDNodeBits.AddressingMode);
2285  }
2286 
2287  /// Return true if this is a pre/post inc/dec load/store.
2288  bool isIndexed() const { return getAddressingMode() != ISD::UNINDEXED; }
2289 
2290  /// Return true if this is NOT a pre/post inc/dec load/store.
2291  bool isUnindexed() const { return getAddressingMode() == ISD::UNINDEXED; }
2292 
2293  static bool classof(const SDNode *N) {
2294  return N->getOpcode() == ISD::LOAD ||
2295  N->getOpcode() == ISD::STORE;
2296  }
2297 };
2298 
2299 /// This class is used to represent ISD::LOAD nodes.
2300 class LoadSDNode : public LSBaseSDNode {
2301  friend class SelectionDAG;
2302 
2303  LoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
2304  ISD::MemIndexedMode AM, ISD::LoadExtType ETy, EVT MemVT,
2306  : LSBaseSDNode(ISD::LOAD, Order, dl, VTs, AM, MemVT, MMO) {
2307  LoadSDNodeBits.ExtTy = ETy;
2308  assert(readMem() && "Load MachineMemOperand is not a load!");
2309  assert(!writeMem() && "Load MachineMemOperand is a store!");
2310  }
2311 
2312 public:
2313  /// Return whether this is a plain node,
2314  /// or one of the varieties of value-extending loads.
2316  return static_cast<ISD::LoadExtType>(LoadSDNodeBits.ExtTy);
2317  }
2318 
2319  const SDValue &getBasePtr() const { return getOperand(1); }
2320  const SDValue &getOffset() const { return getOperand(2); }
2321 
2322  static bool classof(const SDNode *N) {
2323  return N->getOpcode() == ISD::LOAD;
2324  }
2325 };
2326 
2327 /// This class is used to represent ISD::STORE nodes.
2328 class StoreSDNode : public LSBaseSDNode {
2329  friend class SelectionDAG;
2330 
2331  StoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
2332  ISD::MemIndexedMode AM, bool isTrunc, EVT MemVT,
2334  : LSBaseSDNode(ISD::STORE, Order, dl, VTs, AM, MemVT, MMO) {
2335  StoreSDNodeBits.IsTruncating = isTrunc;
2336  assert(!readMem() && "Store MachineMemOperand is a load!");
2337  assert(writeMem() && "Store MachineMemOperand is not a store!");
2338  }
2339 
2340 public:
2341  /// Return true if the op does a truncation before store.
2342  /// For integers this is the same as doing a TRUNCATE and storing the result.
2343  /// For floats, it is the same as doing an FP_ROUND and storing the result.
2344  bool isTruncatingStore() const { return StoreSDNodeBits.IsTruncating; }
2345  void setTruncatingStore(bool Truncating) {
2346  StoreSDNodeBits.IsTruncating = Truncating;
2347  }
2348 
2349  const SDValue &getValue() const { return getOperand(1); }
2350  const SDValue &getBasePtr() const { return getOperand(2); }
2351  const SDValue &getOffset() const { return getOperand(3); }
2352 
2353  static bool classof(const SDNode *N) {
2354  return N->getOpcode() == ISD::STORE;
2355  }
2356 };
2357 
2358 /// This base class is used to represent VP_LOAD and VP_STORE nodes
2360 public:
2361  friend class SelectionDAG;
2362 
2363  VPLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl,
2364  SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT,
2366  : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2367  LSBaseSDNodeBits.AddressingMode = AM;
2368  assert(getAddressingMode() == AM && "Value truncated");
2369  }
2370 
2371  // VPLoadSDNode (Chain, Ptr, Offset, Mask, EVL)
2372  // VPStoreSDNode (Chain, Data, Ptr, Offset, Mask, EVL)
2373  // Mask is a vector of i1 elements;
2374  // the type of EVL is TLI.getVPExplicitVectorLengthTy().
2375  const SDValue &getOffset() const {
2376  return getOperand(getOpcode() == ISD::VP_LOAD ? 2 : 3);
2377  }
2378  const SDValue &getBasePtr() const {
2379  return getOperand(getOpcode() == ISD::VP_LOAD ? 1 : 2);
2380  }
2381  const SDValue &getMask() const {
2382  return getOperand(getOpcode() == ISD::VP_LOAD ? 3 : 4);
2383  }
2384  const SDValue &getVectorLength() const {
2385  return getOperand(getOpcode() == ISD::VP_LOAD ? 4 : 5);
2386  }
2387 
2388  /// Return the addressing mode for this load or store:
2389  /// unindexed, pre-inc, pre-dec, post-inc, or post-dec.
2391  return static_cast<ISD::MemIndexedMode>(LSBaseSDNodeBits.AddressingMode);
2392  }
2393 
2394  /// Return true if this is a pre/post inc/dec load/store.
2395  bool isIndexed() const { return getAddressingMode() != ISD::UNINDEXED; }
2396 
2397  /// Return true if this is NOT a pre/post inc/dec load/store.
2398  bool isUnindexed() const { return getAddressingMode() == ISD::UNINDEXED; }
2399 
2400  static bool classof(const SDNode *N) {
2401  return N->getOpcode() == ISD::VP_LOAD || N->getOpcode() == ISD::VP_STORE;
2402  }
2403 };
2404 
2405 /// This class is used to represent a VP_LOAD node
2407 public:
2408  friend class SelectionDAG;
2409 
2410  VPLoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
2411  ISD::MemIndexedMode AM, ISD::LoadExtType ETy, bool isExpanding,
2412  EVT MemVT, MachineMemOperand *MMO)
2413  : VPLoadStoreSDNode(ISD::VP_LOAD, Order, dl, VTs, AM, MemVT, MMO) {
2414  LoadSDNodeBits.ExtTy = ETy;
2415  LoadSDNodeBits.IsExpanding = isExpanding;
2416  }
2417 
2419  return static_cast<ISD::LoadExtType>(LoadSDNodeBits.ExtTy);
2420  }
2421 
2422  const SDValue &getBasePtr() const { return getOperand(1); }
2423  const SDValue &getOffset() const { return getOperand(2); }
2424  const SDValue &getMask() const { return getOperand(3); }
2425  const SDValue &getVectorLength() const { return getOperand(4); }
2426 
2427  static bool classof(const SDNode *N) {
2428  return N->getOpcode() == ISD::VP_LOAD;
2429  }
2430  bool isExpandingLoad() const { return LoadSDNodeBits.IsExpanding; }
2431 };
2432 
2433 /// This class is used to represent a VP_STORE node
2435 public:
2436  friend class SelectionDAG;
2437 
2438  VPStoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
2439  ISD::MemIndexedMode AM, bool isTrunc, bool isCompressing,
2440  EVT MemVT, MachineMemOperand *MMO)
2441  : VPLoadStoreSDNode(ISD::VP_STORE, Order, dl, VTs, AM, MemVT, MMO) {
2442  StoreSDNodeBits.IsTruncating = isTrunc;
2443  StoreSDNodeBits.IsCompressing = isCompressing;
2444  }
2445 
2446  /// Return true if this is a truncating store.
2447  /// For integers this is the same as doing a TRUNCATE and storing the result.
2448  /// For floats, it is the same as doing an FP_ROUND and storing the result.
2449  bool isTruncatingStore() const { return StoreSDNodeBits.IsTruncating; }
2450 
2451  /// Returns true if the op does a compression to the vector before storing.
2452  /// The node contiguously stores the active elements (integers or floats)
2453  /// in src (those with their respective bit set in writemask k) to unaligned
2454  /// memory at base_addr.
2455  bool isCompressingStore() const { return StoreSDNodeBits.IsCompressing; }
2456 
2457  const SDValue &getValue() const { return getOperand(1); }
2458  const SDValue &getBasePtr() const { return getOperand(2); }
2459  const SDValue &getOffset() const { return getOperand(3); }
2460  const SDValue &getMask() const { return getOperand(4); }
2461  const SDValue &getVectorLength() const { return getOperand(5); }
2462 
2463  static bool classof(const SDNode *N) {
2464  return N->getOpcode() == ISD::VP_STORE;
2465  }
2466 };
2467 
2468 /// This base class is used to represent MLOAD and MSTORE nodes
2470 public:
2471  friend class SelectionDAG;
2472 
2473  MaskedLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order,
2474  const DebugLoc &dl, SDVTList VTs,
2475  ISD::MemIndexedMode AM, EVT MemVT,
2477  : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2478  LSBaseSDNodeBits.AddressingMode = AM;
2479  assert(getAddressingMode() == AM && "Value truncated");
2480  }
2481 
2482  // MaskedLoadSDNode (Chain, ptr, offset, mask, passthru)
2483  // MaskedStoreSDNode (Chain, data, ptr, offset, mask)
2484  // Mask is a vector of i1 elements
2485  const SDValue &getOffset() const {
2486  return getOperand(getOpcode() == ISD::MLOAD ? 2 : 3);
2487  }
2488  const SDValue &getMask() const {
2489  return getOperand(getOpcode() == ISD::MLOAD ? 3 : 4);
2490  }
2491 
2492  /// Return the addressing mode for this load or store:
2493  /// unindexed, pre-inc, pre-dec, post-inc, or post-dec.
2495  return static_cast<ISD::MemIndexedMode>(LSBaseSDNodeBits.AddressingMode);
2496  }
2497 
2498  /// Return true if this is a pre/post inc/dec load/store.
2499  bool isIndexed() const { return getAddressingMode() != ISD::UNINDEXED; }
2500 
2501  /// Return true if this is NOT a pre/post inc/dec load/store.
2502  bool isUnindexed() const { return getAddressingMode() == ISD::UNINDEXED; }
2503 
2504  static bool classof(const SDNode *N) {
2505  return N->getOpcode() == ISD::MLOAD ||
2506  N->getOpcode() == ISD::MSTORE;
2507  }
2508 };
2509 
2510 /// This class is used to represent an MLOAD node
2512 public:
2513  friend class SelectionDAG;
2514 
2515  MaskedLoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
2517  bool IsExpanding, EVT MemVT, MachineMemOperand *MMO)
2518  : MaskedLoadStoreSDNode(ISD::MLOAD, Order, dl, VTs, AM, MemVT, MMO) {
2519  LoadSDNodeBits.ExtTy = ETy;
2520  LoadSDNodeBits.IsExpanding = IsExpanding;
2521  }
2522 
2524  return static_cast<ISD::LoadExtType>(LoadSDNodeBits.ExtTy);
2525  }
2526 
2527  const SDValue &getBasePtr() const { return getOperand(1); }
2528  const SDValue &getOffset() const { return getOperand(2); }
2529  const SDValue &getMask() const { return getOperand(3); }
2530  const SDValue &getPassThru() const { return getOperand(4); }
2531 
2532  static bool classof(const SDNode *N) {
2533  return N->getOpcode() == ISD::MLOAD;
2534  }
2535 
2536  bool isExpandingLoad() const { return LoadSDNodeBits.IsExpanding; }
2537 };
2538 
2539 /// This class is used to represent an MSTORE node
2541 public:
2542  friend class SelectionDAG;
2543 
2544  MaskedStoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
2545  ISD::MemIndexedMode AM, bool isTrunc, bool isCompressing,
2546  EVT MemVT, MachineMemOperand *MMO)
2547  : MaskedLoadStoreSDNode(ISD::MSTORE, Order, dl, VTs, AM, MemVT, MMO) {
2548  StoreSDNodeBits.IsTruncating = isTrunc;
2549  StoreSDNodeBits.IsCompressing = isCompressing;
2550  }
2551 
2552  /// Return true if the op does a truncation before store.
2553  /// For integers this is the same as doing a TRUNCATE and storing the result.
2554  /// For floats, it is the same as doing an FP_ROUND and storing the result.
2555  bool isTruncatingStore() const { return StoreSDNodeBits.IsTruncating; }
2556 
2557  /// Returns true if the op does a compression to the vector before storing.
2558  /// The node contiguously stores the active elements (integers or floats)
2559  /// in src (those with their respective bit set in writemask k) to unaligned
2560  /// memory at base_addr.
2561  bool isCompressingStore() const { return StoreSDNodeBits.IsCompressing; }
2562 
2563  const SDValue &getValue() const { return getOperand(1); }
2564  const SDValue &getBasePtr() const { return getOperand(2); }
2565  const SDValue &getOffset() const { return getOperand(3); }
2566  const SDValue &getMask() const { return getOperand(4); }
2567 
2568  static bool classof(const SDNode *N) {
2569  return N->getOpcode() == ISD::MSTORE;
2570  }
2571 };
2572 
2573 /// This is a base class used to represent
2574 /// VP_GATHER and VP_SCATTER nodes
2575 ///
2577 public:
2578  friend class SelectionDAG;
2579 
2580  VPGatherScatterSDNode(ISD::NodeType NodeTy, unsigned Order,
2581  const DebugLoc &dl, SDVTList VTs, EVT MemVT,
2583  : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2584  LSBaseSDNodeBits.AddressingMode = IndexType;
2585  assert(getIndexType() == IndexType && "Value truncated");
2586  }
2587 
2588  /// How is Index applied to BasePtr when computing addresses.
2590  return static_cast<ISD::MemIndexType>(LSBaseSDNodeBits.AddressingMode);
2591  }
2592  bool isIndexScaled() const {
2593  return (getIndexType() == ISD::SIGNED_SCALED) ||
2595  }
2596  bool isIndexSigned() const {
2597  return (getIndexType() == ISD::SIGNED_SCALED) ||
2599  }
2600 
2601  // In the both nodes address is Op1, mask is Op2:
2602  // VPGatherSDNode (Chain, base, index, scale, mask, vlen)
2603  // VPScatterSDNode (Chain, value, base, index, scale, mask, vlen)
2604  // Mask is a vector of i1 elements
2605  const SDValue &getBasePtr() const {
2606  return getOperand((getOpcode() == ISD::VP_GATHER) ? 1 : 2);
2607  }
2608  const SDValue &getIndex() const {
2609  return getOperand((getOpcode() == ISD::VP_GATHER) ? 2 : 3);
2610  }
2611  const SDValue &getScale() const {
2612  return getOperand((getOpcode() == ISD::VP_GATHER) ? 3 : 4);
2613  }
2614  const SDValue &getMask() const {
2615  return getOperand((getOpcode() == ISD::VP_GATHER) ? 4 : 5);
2616  }
2617  const SDValue &getVectorLength() const {
2618  return getOperand((getOpcode() == ISD::VP_GATHER) ? 5 : 6);
2619  }
2620 
2621  static bool classof(const SDNode *N) {
2622  return N->getOpcode() == ISD::VP_GATHER ||
2623  N->getOpcode() == ISD::VP_SCATTER;
2624  }
2625 };
2626 
2627 /// This class is used to represent an VP_GATHER node
2628 ///
2630 public:
2631  friend class SelectionDAG;
2632 
2633  VPGatherSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT,
2635  : VPGatherScatterSDNode(ISD::VP_GATHER, Order, dl, VTs, MemVT, MMO,
2636  IndexType) {}
2637 
2638  static bool classof(const SDNode *N) {
2639  return N->getOpcode() == ISD::VP_GATHER;
2640  }
2641 };
2642 
2643 /// This class is used to represent an VP_SCATTER node
2644 ///
2646 public:
2647  friend class SelectionDAG;
2648 
2649  VPScatterSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT,
2651  : VPGatherScatterSDNode(ISD::VP_SCATTER, Order, dl, VTs, MemVT, MMO,
2652  IndexType) {}
2653 
2654  const SDValue &getValue() const { return getOperand(1); }
2655 
2656  static bool classof(const SDNode *N) {
2657  return N->getOpcode() == ISD::VP_SCATTER;
2658  }
2659 };
2660 
2661 /// This is a base class used to represent
2662 /// MGATHER and MSCATTER nodes
2663 ///
2665 public:
2666  friend class SelectionDAG;
2667 
2669  const DebugLoc &dl, SDVTList VTs, EVT MemVT,
2671  : MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2672  LSBaseSDNodeBits.AddressingMode = IndexType;
2673  assert(getIndexType() == IndexType && "Value truncated");
2674  }
2675 
2676  /// How is Index applied to BasePtr when computing addresses.
2678  return static_cast<ISD::MemIndexType>(LSBaseSDNodeBits.AddressingMode);
2679  }
2681  LSBaseSDNodeBits.AddressingMode = IndexType;
2682  }
2683  bool isIndexScaled() const {
2684  return (getIndexType() == ISD::SIGNED_SCALED) ||
2686  }
2687  bool isIndexSigned() const {
2688  return (getIndexType() == ISD::SIGNED_SCALED) ||
2690  }
2691 
2692  // In the both nodes address is Op1, mask is Op2:
2693  // MaskedGatherSDNode (Chain, passthru, mask, base, index, scale)
2694  // MaskedScatterSDNode (Chain, value, mask, base, index, scale)
2695  // Mask is a vector of i1 elements
2696  const SDValue &getBasePtr() const { return getOperand(3); }
2697  const SDValue &getIndex() const { return getOperand(4); }
2698  const SDValue &getMask() const { return getOperand(2); }
2699  const SDValue &getScale() const { return getOperand(5); }
2700 
2701  static bool classof(const SDNode *N) {
2702  return N->getOpcode() == ISD::MGATHER ||
2703  N->getOpcode() == ISD::MSCATTER;
2704  }
2705 };
2706 
2707 /// This class is used to represent an MGATHER node
2708 ///
2710 public:
2711  friend class SelectionDAG;
2712 
2713  MaskedGatherSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
2714  EVT MemVT, MachineMemOperand *MMO,
2715  ISD::MemIndexType IndexType, ISD::LoadExtType ETy)
2716  : MaskedGatherScatterSDNode(ISD::MGATHER, Order, dl, VTs, MemVT, MMO,
2717  IndexType) {
2718  LoadSDNodeBits.ExtTy = ETy;
2719  }
2720 
2721  const SDValue &getPassThru() const { return getOperand(1); }
2722 
2724  return ISD::LoadExtType(LoadSDNodeBits.ExtTy);
2725  }
2726 
2727  static bool classof(const SDNode *N) {
2728  return N->getOpcode() == ISD::MGATHER;
2729  }
2730 };
2731 
2732 /// This class is used to represent an MSCATTER node
2733 ///
2735 public:
2736  friend class SelectionDAG;
2737 
2738  MaskedScatterSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs,
2739  EVT MemVT, MachineMemOperand *MMO,
2740  ISD::MemIndexType IndexType, bool IsTrunc)
2741  : MaskedGatherScatterSDNode(ISD::MSCATTER, Order, dl, VTs, MemVT, MMO,
2742  IndexType) {
2743  StoreSDNodeBits.IsTruncating = IsTrunc;
2744  }
2745 
2746  /// Return true if the op does a truncation before store.
2747  /// For integers this is the same as doing a TRUNCATE and storing the result.
2748  /// For floats, it is the same as doing an FP_ROUND and storing the result.
2749  bool isTruncatingStore() const { return StoreSDNodeBits.IsTruncating; }
2750 
2751  const SDValue &getValue() const { return getOperand(1); }
2752 
2753  static bool classof(const SDNode *N) {
2754  return N->getOpcode() == ISD::MSCATTER;
2755  }
2756 };
2757 
2758 /// An SDNode that represents everything that will be needed
2759 /// to construct a MachineInstr. These nodes are created during the
2760 /// instruction selection proper phase.
2761 ///
2762 /// Note that the only supported way to set the `memoperands` is by calling the
2763 /// `SelectionDAG::setNodeMemRefs` function as the memory management happens
2764 /// inside the DAG rather than in the node.
2765 class MachineSDNode : public SDNode {
2766 private:
2767  friend class SelectionDAG;
2768 
2769  MachineSDNode(unsigned Opc, unsigned Order, const DebugLoc &DL, SDVTList VTs)
2770  : SDNode(Opc, Order, DL, VTs) {}
2771 
2772  // We use a pointer union between a single `MachineMemOperand` pointer and
2773  // a pointer to an array of `MachineMemOperand` pointers. This is null when
2774  // the number of these is zero, the single pointer variant used when the
2775  // number is one, and the array is used for larger numbers.
2776  //
2777  // The array is allocated via the `SelectionDAG`'s allocator and so will
2778  // always live until the DAG is cleaned up and doesn't require ownership here.
2779  //
2780  // We can't use something simpler like `TinyPtrVector` here because `SDNode`
2781  // subclasses aren't managed in a conforming C++ manner. See the comments on
2782  // `SelectionDAG::MorphNodeTo` which details what all goes on, but the
2783  // constraint here is that these don't manage memory with their constructor or
2784  // destructor and can be initialized to a good state even if they start off
2785  // uninitialized.
2787 
2788  // Note that this could be folded into the above `MemRefs` member if doing so
2789  // is advantageous at some point. We don't need to store this in most cases.
2790  // However, at the moment this doesn't appear to make the allocation any
2791  // smaller and makes the code somewhat simpler to read.
2792  int NumMemRefs = 0;
2793 
2794 public:
2796 
2798  // Special case the common cases.
2799  if (NumMemRefs == 0)
2800  return {};
2801  if (NumMemRefs == 1)
2802  return makeArrayRef(MemRefs.getAddrOfPtr1(), 1);
2803 
2804  // Otherwise we have an actual array.
2805  return makeArrayRef(MemRefs.get<MachineMemOperand **>(), NumMemRefs);
2806  }
2807  mmo_iterator memoperands_begin() const { return memoperands().begin(); }
2808  mmo_iterator memoperands_end() const { return memoperands().end(); }
2809  bool memoperands_empty() const { return memoperands().empty(); }
2810 
2811  /// Clear out the memory reference descriptor list.
2812  void clearMemRefs() {
2813  MemRefs = nullptr;
2814  NumMemRefs = 0;
2815  }
2816 
2817  static bool classof(const SDNode *N) {
2818  return N->isMachineOpcode();
2819  }
2820 };
2821 
2822 /// An SDNode that records if a register contains a value that is guaranteed to
2823 /// be aligned accordingly.
2824 class AssertAlignSDNode : public SDNode {
2825  Align Alignment;
2826 
2827 public:
2828  AssertAlignSDNode(unsigned Order, const DebugLoc &DL, EVT VT, Align A)
2829  : SDNode(ISD::AssertAlign, Order, DL, getSDVTList(VT)), Alignment(A) {}
2830 
2831  Align getAlign() const { return Alignment; }
2832 
2833  static bool classof(const SDNode *N) {
2834  return N->getOpcode() == ISD::AssertAlign;
2835  }
2836 };
2837 
2839  const SDNode *Node;
2840  unsigned Operand;
2841 
2842  SDNodeIterator(const SDNode *N, unsigned Op) : Node(N), Operand(Op) {}
2843 
2844 public:
2845  using iterator_category = std::forward_iterator_tag;
2847  using difference_type = std::ptrdiff_t;
2848  using pointer = value_type *;
2850 
2851  bool operator==(const SDNodeIterator& x) const {
2852  return Operand == x.Operand;
2853  }
2854  bool operator!=(const SDNodeIterator& x) const { return !operator==(x); }
2855 
2856  pointer operator*() const {
2857  return Node->getOperand(Operand).getNode();
2858  }
2859  pointer operator->() const { return operator*(); }
2860 
2861  SDNodeIterator& operator++() { // Preincrement
2862  ++Operand;
2863  return *this;
2864  }
2865  SDNodeIterator operator++(int) { // Postincrement
2866  SDNodeIterator tmp = *this; ++*this; return tmp;
2867  }
2868  size_t operator-(SDNodeIterator Other) const {
2869  assert(Node == Other.Node &&
2870  "Cannot compare iterators of two different nodes!");
2871  return Operand - Other.Operand;
2872  }
2873 
2874  static SDNodeIterator begin(const SDNode *N) { return SDNodeIterator(N, 0); }
2875  static SDNodeIterator end (const SDNode *N) {
2876  return SDNodeIterator(N, N->getNumOperands());
2877  }
2878 
2879  unsigned getOperand() const { return Operand; }
2880  const SDNode *getNode() const { return Node; }
2881 };
2882 
2883 template <> struct GraphTraits<SDNode*> {
2884  using NodeRef = SDNode *;
2886 
2887  static NodeRef getEntryNode(SDNode *N) { return N; }
2888 
2890  return SDNodeIterator::begin(N);
2891  }
2892 
2894  return SDNodeIterator::end(N);
2895  }
2896 };
2897 
2898 /// A representation of the largest SDNode, for use in sizeof().
2899 ///
2900 /// This needs to be a union because the largest node differs on 32 bit systems
2901 /// with 4 and 8 byte pointer alignment, respectively.
2902 using LargestSDNode = AlignedCharArrayUnion<AtomicSDNode, TargetIndexSDNode,
2903  BlockAddressSDNode,
2904  GlobalAddressSDNode,
2906 
2907 /// The SDNode class with the greatest alignment requirement.
2909 
2910 namespace ISD {
2911 
2912  /// Returns true if the specified node is a non-extending and unindexed load.
2913  inline bool isNormalLoad(const SDNode *N) {
2914  const LoadSDNode *Ld = dyn_cast<LoadSDNode>(N);
2915  return Ld && Ld->getExtensionType() == ISD::NON_EXTLOAD &&
2917  }
2918 
2919  /// Returns true if the specified node is a non-extending load.
2920  inline bool isNON_EXTLoad(const SDNode *N) {
2921  return isa<LoadSDNode>(N) &&
2922  cast<LoadSDNode>(N)->getExtensionType() == ISD::NON_EXTLOAD;
2923  }
2924 
2925  /// Returns true if the specified node is a EXTLOAD.
2926  inline bool isEXTLoad(const SDNode *N) {
2927  return isa<LoadSDNode>(N) &&
2928  cast<LoadSDNode>(N)->getExtensionType() == ISD::EXTLOAD;
2929  }
2930 
2931  /// Returns true if the specified node is a SEXTLOAD.
2932  inline bool isSEXTLoad(const SDNode *N) {
2933  return isa<LoadSDNode>(N) &&
2934  cast<LoadSDNode>(N)->getExtensionType() == ISD::SEXTLOAD;
2935  }
2936 
2937  /// Returns true if the specified node is a ZEXTLOAD.
2938  inline bool isZEXTLoad(const SDNode *N) {
2939  return isa<LoadSDNode>(N) &&
2940  cast<LoadSDNode>(N)->getExtensionType() == ISD::ZEXTLOAD;
2941  }
2942 
2943  /// Returns true if the specified node is an unindexed load.
2944  inline bool isUNINDEXEDLoad(const SDNode *N) {
2945  return isa<LoadSDNode>(N) &&
2946  cast<LoadSDNode>(N)->getAddressingMode() == ISD::UNINDEXED;
2947  }
2948 
2949  /// Returns true if the specified node is a non-truncating
2950  /// and unindexed store.
2951  inline bool isNormalStore(const SDNode *N) {
2952  const StoreSDNode *St = dyn_cast<StoreSDNode>(N);
2953  return St && !St->isTruncatingStore() &&
2955  }
2956 
2957  /// Returns true if the specified node is an unindexed store.
2958  inline bool isUNINDEXEDStore(const SDNode *N) {
2959  return isa<StoreSDNode>(N) &&
2960  cast<StoreSDNode>(N)->getAddressingMode() == ISD::UNINDEXED;
2961  }
2962 
2963  /// Attempt to match a unary predicate against a scalar/splat constant or
2964  /// every element of a constant BUILD_VECTOR.
2965  /// If AllowUndef is true, then UNDEF elements will pass nullptr to Match.
2967  std::function<bool(ConstantSDNode *)> Match,
2968  bool AllowUndefs = false);
2969 
2970  /// Attempt to match a binary predicate against a pair of scalar/splat
2971  /// constants or every element of a pair of constant BUILD_VECTORs.
2972  /// If AllowUndef is true, then UNDEF elements will pass nullptr to Match.
2973  /// If AllowTypeMismatch is true then RetType + ArgTypes don't need to match.
2974  bool matchBinaryPredicate(
2976  std::function<bool(ConstantSDNode *, ConstantSDNode *)> Match,
2977  bool AllowUndefs = false, bool AllowTypeMismatch = false);
2978 
2979  /// Returns true if the specified value is the overflow result from one
2980  /// of the overflow intrinsic nodes.
2982  unsigned Opc = Op.getOpcode();
2983  return (Op.getResNo() == 1 &&
2984  (Opc == ISD::SADDO || Opc == ISD::UADDO || Opc == ISD::SSUBO ||
2985  Opc == ISD::USUBO || Opc == ISD::SMULO || Opc == ISD::UMULO));
2986  }
2987 
2988 } // end namespace ISD
2989 
2990 } // end namespace llvm
2991 
2992 #endif // LLVM_CODEGEN_SELECTIONDAGNODES_H
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::SDNode::getConstantOperandVal
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
Definition: SelectionDAGNodes.h:1599
llvm::AddrSpaceCastSDNode::AddrSpaceCastSDNode
AddrSpaceCastSDNode(unsigned Order, const DebugLoc &dl, EVT VT, unsigned SrcAS, unsigned DestAS)
Definition: SelectionDAG.cpp:10097
i
i
Definition: README.txt:29
llvm::ISD::ExternalSymbol
@ ExternalSymbol
Definition: ISDOpcodes.h:83
llvm::ISD::isUNINDEXEDStore
bool isUNINDEXEDStore(const SDNode *N)
Returns true if the specified node is an unindexed store.
Definition: SelectionDAGNodes.h:2958
llvm::SDNodeFlags::hasAllowReciprocal
bool hasAllowReciprocal() const
Definition: SelectionDAGNodes.h:429
llvm::MCSymbolSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2225
llvm::SDNode::use_iterator::use_iterator
use_iterator()=default
llvm::LoadSDNode::getOffset
const SDValue & getOffset() const
Definition: SelectionDAGNodes.h:2320
set
We currently generate a but we really shouldn eax ecx xorl edx divl ecx eax divl ecx movl eax ret A similar code sequence works for division We currently compile i32 v2 eax eax jo LBB1_2 atomic and others It is also currently not done for read modify write instructions It is also current not done if the OF or CF flags are needed The shift operators have the complication that when the shift count is EFLAGS is not set
Definition: README.txt:1277
ValueTypes.h
llvm::SDNode::StoreSDNodeBits
StoreSDNodeBitfields StoreSDNodeBits
Definition: SelectionDAGNodes.h:562
llvm::ShuffleVectorSDNode::getSplatIndex
int getSplatIndex() const
Definition: SelectionDAGNodes.h:1524
llvm::ConstantSDNode
Definition: SelectionDAGNodes.h:1558
llvm::RegisterSDNode
Definition: SelectionDAGNodes.h:2117
llvm::MaskedLoadSDNode::getExtensionType
ISD::LoadExtType getExtensionType() const
Definition: SelectionDAGNodes.h:2523
llvm::SDNode::Profile
void Profile(FoldingSetNodeID &ID) const
Gather unique data for the node.
Definition: SelectionDAG.cpp:10121
llvm::MachineMemOperand::isStore
bool isStore() const
Definition: MachineMemOperand.h:289
llvm::StoreSDNode::getBasePtr
const SDValue & getBasePtr() const
Definition: SelectionDAGNodes.h:2350
llvm::isConstOrConstSplat
ConstantSDNode * isConstOrConstSplat(SDValue N, bool AllowUndefs=false, bool AllowTruncation=false)
Returns the SDNode if it is a constant splat BuildVector or constant int.
Definition: SelectionDAG.cpp:9970
llvm::ISD::VECTOR_SHUFFLE
@ VECTOR_SHUFFLE
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
Definition: ISDOpcodes.h:563
llvm::SDValue::dump
void dump() const
Definition: SelectionDAGNodes.h:1175
llvm::ISD::INTRINSIC_VOID
@ INTRINSIC_VOID
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
Definition: ISDOpcodes.h:199
llvm::ISD::isOverflowIntrOpRes
bool isOverflowIntrOpRes(SDValue Op)
Returns true if the specified value is the overflow result from one of the overflow intrinsic nodes.
Definition: SelectionDAGNodes.h:2981
llvm::SDUse
Represents a use of a SDNode.
Definition: SelectionDAGNodes.h:276
llvm::ISD::MemIndexedMode
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
Definition: ISDOpcodes.h:1319
llvm::AddrSpaceCastSDNode::getSrcAddressSpace
unsigned getSrcAddressSpace() const
Definition: SelectionDAGNodes.h:1247
llvm::isConstOrConstSplatFP
ConstantFPSDNode * isConstOrConstSplatFP(SDValue N, bool AllowUndefs=false)
Returns the SDNode if it is a constant splat BuildVector or constant float.
Definition: SelectionDAG.cpp:10029
llvm::MaskedLoadStoreSDNode::getMask
const SDValue & getMask() const
Definition: SelectionDAGNodes.h:2488
llvm::MaskedGatherSDNode
This class is used to represent an MGATHER node.
Definition: SelectionDAGNodes.h:2709
llvm::ISD::UMULO
@ UMULO
Definition: ISDOpcodes.h:319
llvm::VPLoadSDNode::getOffset
const SDValue & getOffset() const
Definition: SelectionDAGNodes.h:2423
llvm::MemSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1379
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
Reg
unsigned Reg
Definition: MachineSink.cpp:1563
llvm::ISD::JumpTable
@ JumpTable
Definition: ISDOpcodes.h:81
llvm::SDNode::NumMemSDNodeBits
@ NumMemSDNodeBits
Definition: SelectionDAGNodes.h:507
llvm::LifetimeSDNode::getSize
int64_t getSize() const
Definition: SelectionDAGNodes.h:1785
llvm::SDNode::getIROrder
unsigned getIROrder() const
Return the node ordering.
Definition: SelectionDAGNodes.h:715
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::objcarc::Sequence
Sequence
Definition: PtrState.h:41
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::SDNode::getValueType
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
Definition: SelectionDAGNodes.h:968
llvm::SDNodeFlags::setNoSignedZeros
void setNoSignedZeros(bool b)
Definition: SelectionDAGNodes.h:415
llvm::make_range
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Definition: iterator_range.h:53
llvm::SDNode::value_op_iterator::operator*
const SDValue & operator*() const
Definition: SelectionDAGNodes.h:926
llvm::VPStoreSDNode::getVectorLength
const SDValue & getVectorLength() const
Definition: SelectionDAGNodes.h:2461
llvm::SDLoc
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Definition: SelectionDAGNodes.h:1088
llvm::VPLoadSDNode::getVectorLength
const SDValue & getVectorLength() const
Definition: SelectionDAGNodes.h:2425
Metadata.h
llvm::ISD::LIFETIME_END
@ LIFETIME_END
Definition: ISDOpcodes.h:1182
llvm::VPStoreSDNode::getMask
const SDValue & getMask() const
Definition: SelectionDAGNodes.h:2460
llvm::simplify_type< SDValue >::getSimplifiedValue
static SimpleType getSimplifiedValue(SDValue &Val)
Definition: SelectionDAGNodes.h:259
llvm::SDNode::setIROrder
void setIROrder(unsigned Order)
Set the node ordering.
Definition: SelectionDAGNodes.h:718
llvm::MachineMemOperand::getAlign
Align getAlign() const
Return the minimum known alignment in bytes of the actual memory reference.
Definition: MachineOperand.cpp:1089
llvm::ConstantSDNode::getAPIntValue
const APInt & getAPIntValue() const
Definition: SelectionDAGNodes.h:1572
llvm::SDValue::use_empty
bool use_empty() const
Return true if there are no nodes using value ResNo of Node.
Definition: SelectionDAGNodes.h:1163
llvm::ConstantFPSDNode::isNegative
bool isNegative() const
Return true if the value is negative.
Definition: SelectionDAGNodes.h:1631
llvm::ISD::NON_EXTLOAD
@ NON_EXTLOAD
Definition: ISDOpcodes.h:1350
AtomicOrdering.h
llvm::VPGatherScatterSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2621
llvm::EVT::getFixedSizeInBits
uint64_t getFixedSizeInBits() const
Return the size of the specified fixed width value type in bits.
Definition: ValueTypes.h:349
llvm::AssertAlignSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2833
llvm::ISD::ATOMIC_LOAD_UMAX
@ ATOMIC_LOAD_UMAX
Definition: ISDOpcodes.h:1154
llvm::SDValue::getNode
SDNode * getNode() const
get the SDNode which holds the desired result
Definition: SelectionDAGNodes.h:151
llvm::isOneConstant
bool isOneConstant(SDValue V)
Returns true if V is a constant integer one.
Definition: SelectionDAG.cpp:9937
llvm::SDNode::use_size
size_t use_size() const
Return the number of uses of this node.
Definition: SelectionDAGNodes.h:706
llvm::ISD::ConstantFP
@ ConstantFP
Definition: ISDOpcodes.h:77
llvm::VPStoreSDNode::getOffset
const SDValue & getOffset() const
Definition: SelectionDAGNodes.h:2459
llvm::VPLoadStoreSDNode
This base class is used to represent VP_LOAD and VP_STORE nodes.
Definition: SelectionDAGNodes.h:2359
llvm::VPGatherScatterSDNode::isIndexScaled
bool isIndexScaled() const
Definition: SelectionDAGNodes.h:2592
llvm::ISD::LIFETIME_START
@ LIFETIME_START
This corresponds to the llvm.lifetime.
Definition: ISDOpcodes.h:1181
llvm::SDNode::getMaxNumOperands
static constexpr size_t getMaxNumOperands()
Return the maximum number of operands that a SDNode can hold.
Definition: SelectionDAGNodes.h:896
llvm::SDNodeFlags::setAllowContract
void setAllowContract(bool b)
Definition: SelectionDAGNodes.h:417
llvm::ISD::UADDO
@ UADDO
Definition: ISDOpcodes.h:311
llvm::SDNode::intersectFlagsWith
void intersectFlagsWith(const SDNodeFlags Flags)
Clear any flags in this node that aren't also set in Flags.
Definition: SelectionDAG.cpp:10276
llvm::ISD::ATOMIC_LOAD_CLR
@ ATOMIC_LOAD_CLR
Definition: ISDOpcodes.h:1147
llvm::SDNode::use_iterator::atEnd
bool atEnd() const
Return true if this iterator is at the end of uses list.
Definition: SelectionDAGNodes.h:754
llvm::SDNode::isUndef
bool isUndef() const
Return true if the type of the node type undefined.
Definition: SelectionDAGNodes.h:651
llvm::SDNode::isTargetStrictFPOpcode
bool isTargetStrictFPOpcode() const
Test if this node has a target-specific opcode that may raise FP exceptions (in the <target>ISD names...
Definition: SelectionDAGNodes.h:639
llvm::BuildVectorSDNode::getConstantFPSplatPow2ToLog2Int
int32_t getConstantFPSplatPow2ToLog2Int(BitVector *UndefElements, uint32_t BitWidth) const
If this is a constant FP splat and the splatted constant FP is an exact power or 2,...
Definition: SelectionDAG.cpp:10881
llvm::TargetIndexSDNode::getOffset
int64_t getOffset() const
Definition: SelectionDAGNodes.h:1921
llvm::DenseMapInfo< SDValue >::isEqual
static bool isEqual(const SDValue &LHS, const SDValue &RHS)
Definition: SelectionDAGNodes.h:249
llvm::SDNode::op_values
iterator_range< value_op_iterator > op_values() const
Definition: SelectionDAGNodes.h:929
llvm::AtomicSDNode::isCompareAndSwap
bool isCompareAndSwap() const
Returns true if this SDNode represents cmpxchg atomic operation, false otherwise.
Definition: SelectionDAGNodes.h:1434
TypeSize.h
llvm::ISD::MLOAD
@ MLOAD
Definition: ISDOpcodes.h:1164
llvm::MemSDNode::getSyncScopeID
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID for this memory operation.
Definition: SelectionDAGNodes.h:1312
op
#define op(i)
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1177
llvm::ISD::SIGNED_SCALED
@ SIGNED_SCALED
Definition: ISDOpcodes.h:1332
llvm::SDNodeFlags::hasNoNaNs
bool hasNoNaNs() const
Definition: SelectionDAGNodes.h:426
llvm::MemSDNode::getMergedOrdering
AtomicOrdering getMergedOrdering() const
Return a single atomic ordering that is at least as strong as both the success and failure orderings ...
Definition: SelectionDAGNodes.h:1324
llvm::MaskedStoreSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2568
llvm::MachineMemOperand::isLoad
bool isLoad() const
Definition: MachineMemOperand.h:288
llvm::MachineMemOperand::getOffset
int64_t getOffset() const
For normal values, this is a byte offset added to the base address.
Definition: MachineMemOperand.h:227
llvm::ISD::CONDCODE
@ CONDCODE
Definition: ISDOpcodes.h:73
llvm::iterator_adaptor_base< value_op_iterator, op_iterator, std::random_access_iterator_tag, SDValue, ptrdiff_t, value_op_iterator *, value_op_iterator * >::I
op_iterator I
Definition: iterator.h:241
llvm::ISD::TargetIndex
@ TargetIndex
TargetIndex - Like a constant pool entry, but with completely target-dependent semantics.
Definition: ISDOpcodes.h:177
llvm::SDVTList::NumVTs
unsigned int NumVTs
Definition: SelectionDAGNodes.h:80
llvm::MachineSDNode
An SDNode that represents everything that will be needed to construct a MachineInstr.
Definition: SelectionDAGNodes.h:2765
llvm::ConstantSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1593
llvm::SDNodeFlags::SDNodeFlags
SDNodeFlags()
Default constructor turns off all optimization flags.
Definition: SelectionDAGNodes.h:392
ErrorHandling.h
llvm::isBitwiseNot
bool isBitwiseNot(SDValue V, bool AllowUndefs=false)
Returns true if V is a bitwise not operation.
Definition: SelectionDAG.cpp:9960
llvm::SDValue::SDValue
SDValue()=default
llvm::ISD::MGATHER
@ MGATHER
Definition: ISDOpcodes.h:1176
llvm::VTSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2261
llvm::SDNodeIterator::operator->
pointer operator->() const
Definition: SelectionDAGNodes.h:2859
llvm::LifetimeSDNode::hasOffset
bool hasOffset() const
Definition: SelectionDAGNodes.h:1780
llvm::ShuffleVectorSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1553
llvm::ISD::EH_LABEL
@ EH_LABEL
EH_LABEL - Represents a label in mid basic block used to track locations needed for debug and excepti...
Definition: ISDOpcodes.h:992
llvm::MachineSDNode::memoperands_begin
mmo_iterator memoperands_begin() const
Definition: SelectionDAGNodes.h:2807
llvm::HandleSDNode
This class is used to form a handle around another node that is persistent and is updated across invo...
Definition: SelectionDAGNodes.h:1214
llvm::ISD::MemIndexType
MemIndexType
MemIndexType enum - This enum defines how to interpret MGATHER/SCATTER's index parameter when calcula...
Definition: ISDOpcodes.h:1331
llvm::MemSDNode::getMemoryVT
EVT getMemoryVT() const
Return the type of the in-memory value.
Definition: SelectionDAGNodes.h:1338
llvm::MemSDNode::getChain
const SDValue & getChain() const
Definition: SelectionDAGNodes.h:1361
llvm::LifetimeSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1791
llvm::SDNode
Represents one node in the SelectionDAG.
Definition: SelectionDAGNodes.h:454
llvm::GlobalAddressSDNode::getTargetFlags
unsigned getTargetFlags() const
Definition: SelectionDAGNodes.h:1734
llvm::ConstantPool
Definition: ConstantPools.h:43
llvm::ConstantSDNode::isAllOnes
bool isAllOnes() const
Definition: SelectionDAGNodes.h:1585
llvm::SDNodeIterator::operator-
size_t operator-(SDNodeIterator Other) const
Definition: SelectionDAGNodes.h:2868
llvm::VPLoadStoreSDNode::isIndexed
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
Definition: SelectionDAGNodes.h:2395
llvm::LoadSDNode
This class is used to represent ISD::LOAD nodes.
Definition: SelectionDAGNodes.h:2300
llvm::MVT::Glue
@ Glue
Definition: MachineValueType.h:262
llvm::RegisterMaskSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2146
llvm::SDNode::use_iterator
This class provides iterator support for SDUse operands that use a specific SDNode.
Definition: SelectionDAGNodes.h:729
llvm::VPLoadSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2427
llvm::MaskedGatherScatterSDNode::getMask
const SDValue & getMask() const
Definition: SelectionDAGNodes.h:2698
llvm::MachineSDNode::memoperands_empty
bool memoperands_empty() const
Definition: SelectionDAGNodes.h:2809
llvm::MachineConstantPoolValue
Abstract base class for all machine specific constantpool value subclasses.
Definition: MachineConstantPool.h:35
llvm::Depth
@ Depth
Definition: SIMachineScheduler.h:36
llvm::MemIntrinsicSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1483
llvm::AAMDNodes
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Definition: Metadata.h:651
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::VPLoadStoreSDNode::isUnindexed
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
Definition: SelectionDAGNodes.h:2398
llvm::MemSDNode::getBasePtr
const SDValue & getBasePtr() const
Definition: SelectionDAGNodes.h:1363
llvm::MachineMemOperand
A description of a memory reference used in the backend.
Definition: MachineMemOperand.h:128
llvm::iterator_adaptor_base
CRTP base class for adapting an iterator to a different type.
Definition: iterator.h:235
llvm::VPGatherScatterSDNode::getBasePtr
const SDValue & getBasePtr() const
Definition: SelectionDAGNodes.h:2605
llvm::MaskedLoadSDNode::MaskedLoadSDNode
MaskedLoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, bool IsExpanding, EVT MemVT, MachineMemOperand *MMO)
Definition: SelectionDAGNodes.h:2515
llvm::SDNode::StoreSDNodeBitfields
Definition: SelectionDAGNodes.h:542
llvm::LargestSDNode
AlignedCharArrayUnion< AtomicSDNode, TargetIndexSDNode, BlockAddressSDNode, GlobalAddressSDNode, PseudoProbeSDNode > LargestSDNode
A representation of the largest SDNode, for use in sizeof().
Definition: SelectionDAGNodes.h:2905
llvm::MaskedStoreSDNode
This class is used to represent an MSTORE node.
Definition: SelectionDAGNodes.h:2540
llvm::SDValue::isTargetOpcode
bool isTargetOpcode() const
Definition: SelectionDAGNodes.h:1143
isBigEndian
static Optional< bool > isBigEndian(const SmallDenseMap< int64_t, int64_t, 8 > &MemOffset2Idx, int64_t LowestIdx)
Given a map from byte offsets in memory to indices in a load/store, determine if that map corresponds...
Definition: CombinerHelper.cpp:110
llvm::LabelSDNode::getLabel
MCSymbol * getLabel() const
Definition: SelectionDAGNodes.h:2185
llvm::VPGatherSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2638
llvm::SDNode::isPredecessorOf
bool isPredecessorOf(const SDNode *N) const
Return true if this node is a predecessor of N.
Definition: SelectionDAGNodes.h:815
llvm::SDNode::MemSDNodeBits
MemSDNodeBitfields MemSDNodeBits
Definition: SelectionDAGNodes.h:559
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:80
llvm::MemSDNode
This is an abstract virtual class for memory operations.
Definition: SelectionDAGNodes.h:1256
llvm::VPLoadSDNode::VPLoadSDNode
VPLoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, bool isExpanding, EVT MemVT, MachineMemOperand *MMO)
Definition: SelectionDAGNodes.h:2410
llvm::SDNodeFlags::setAllowReassociation
void setAllowReassociation(bool b)
Definition: SelectionDAGNodes.h:419
llvm::SDNode::printrFull
void printrFull(raw_ostream &O, const SelectionDAG *G=nullptr) const
Print a SelectionDAG node and all children down to the leaves.
Definition: SelectionDAGDumper.cpp:1031
llvm::SDNodeIterator::getOperand
unsigned getOperand() const
Definition: SelectionDAGNodes.h:2879
llvm::ISD::isConstantSplatVectorAllZeros
bool isConstantSplatVectorAllZeros(const SDNode *N, bool BuildVectorOnly=false)
Return true if the specified node is a BUILD_VECTOR or SPLAT_VECTOR where all of the elements are 0 o...
Definition: SelectionDAG.cpp:221
Operator.h
llvm::VPLoadSDNode::isExpandingLoad
bool isExpandingLoad() const
Definition: SelectionDAGNodes.h:2430
llvm::ConstantSDNode::isZero
bool isZero() const
Definition: SelectionDAGNodes.h:1582
llvm::AddrSpaceCastSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1250
llvm::simplify_type< const SDValue >::getSimplifiedValue
static SimpleType getSimplifiedValue(const SDValue &Val)
Definition: SelectionDAGNodes.h:266
llvm::AtomicSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1448
AlignOf.h
llvm::MipsISD::Ret
@ Ret
Definition: MipsISelLowering.h:116
llvm::SDNode::printr
void printr(raw_ostream &OS, const SelectionDAG *G=nullptr) const
Definition: SelectionDAGDumper.cpp:939
llvm::ISD::EXTLOAD
@ EXTLOAD
Definition: ISDOpcodes.h:1350
llvm::SmallVectorImpl::pop_back_val
LLVM_NODISCARD T pop_back_val()
Definition: SmallVector.h:644
llvm::LSBaseSDNode::isIndexed
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
Definition: SelectionDAGNodes.h:2288
RHS
Value * RHS
Definition: X86PartialReduction.cpp:74
llvm::FPMathOperator::hasNoNaNs
bool hasNoNaNs() const
Test if this operation's arguments and results are assumed not-NaN.
Definition: Operator.h:352
llvm::SDNodeIterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: SelectionDAGNodes.h:2845
llvm::HandleSDNode::HandleSDNode
HandleSDNode(SDValue X)
Definition: SelectionDAGNodes.h:1218
llvm::AssertAlignSDNode::getAlign
Align getAlign() const
Definition: SelectionDAGNodes.h:2831
llvm::SDNode::SDNodeBitfields
Definition: SelectionDAGNodes.h:475
llvm::MaskedGatherScatterSDNode
This is a base class used to represent MGATHER and MSCATTER nodes.
Definition: SelectionDAGNodes.h:2664
llvm::VPLoadStoreSDNode::getMask
const SDValue & getMask() const
Definition: SelectionDAGNodes.h:2381
tmp
alloca< 16 x float >, align 16 %tmp2=alloca< 16 x float >, align 16 store< 16 x float > %A,< 16 x float > *%tmp %s=bitcast< 16 x float > *%tmp to i8 *%s2=bitcast< 16 x float > *%tmp2 to i8 *call void @llvm.memcpy.i64(i8 *%s, i8 *%s2, i64 64, i32 16) %R=load< 16 x float > *%tmp2 ret< 16 x float > %R } declare void @llvm.memcpy.i64(i8 *nocapture, i8 *nocapture, i64, i32) nounwind which compiles to:_foo:subl $140, %esp movaps %xmm3, 112(%esp) movaps %xmm2, 96(%esp) movaps %xmm1, 80(%esp) movaps %xmm0, 64(%esp) movl 60(%esp), %eax movl %eax, 124(%esp) movl 56(%esp), %eax movl %eax, 120(%esp) movl 52(%esp), %eax< many many more 32-bit copies > movaps(%esp), %xmm0 movaps 16(%esp), %xmm1 movaps 32(%esp), %xmm2 movaps 48(%esp), %xmm3 addl $140, %esp ret On Nehalem, it may even be cheaper to just use movups when unaligned than to fall back to lower-granularity chunks. Implement processor-specific optimizations for parity with GCC on these processors. GCC does two optimizations:1. ix86_pad_returns inserts a noop before ret instructions if immediately preceded by a conditional branch or is the target of a jump. 2. ix86_avoid_jump_misspredicts inserts noops in cases where a 16-byte block of code contains more than 3 branches. The first one is done for all AMDs, Core2, and "Generic" The second one is done for:Atom, Pentium Pro, all AMDs, Pentium 4, Nocona, Core 2, and "Generic" Testcase:int x(int a) { return(a &0xf0)> >4 tmp
Definition: README.txt:1347
llvm::VPStoreSDNode::getValue
const SDValue & getValue() const
Definition: SelectionDAGNodes.h:2457
llvm::SDNodeIterator::difference_type
std::ptrdiff_t difference_type
Definition: SelectionDAGNodes.h:2847
llvm::SDNode::isDivergent
bool isDivergent() const
Definition: SelectionDAGNodes.h:696
llvm::SDNode::use_iterator::operator*
SDNode * operator*() const
Retrieve a pointer to the current user node.
Definition: SelectionDAGNodes.h:768
llvm::BlockAddressSDNode
Definition: SelectionDAGNodes.h:2151
llvm::ConstantPoolSDNode::getAlign
Align getAlign() const
Definition: SelectionDAGNodes.h:1895
llvm::SDNode::use_iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: SelectionDAGNodes.h:737
llvm::MachineMemOperand::getAAInfo
AAMDNodes getAAInfo() const
Return the AA tags for the memory reference.
Definition: MachineMemOperand.h:258
llvm::MachineMemOperand::isUnordered
bool isUnordered() const
Returns true if this memory operation doesn't have any ordering constraints other than normal aliasin...
Definition: MachineMemOperand.h:304
llvm::ArrayRef::const_iterator
const_pointer const_iterator
Definition: ArrayRef.h:49
llvm::BitmaskEnumDetail::Mask
std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Definition: BitmaskEnum.h:80
llvm::GraphTraits< SDNode * >::child_end
static ChildIteratorType child_end(NodeRef N)
Definition: SelectionDAGNodes.h:2893
llvm::SDNode::RawSDNodeBits
char RawSDNodeBits[sizeof(uint16_t)]
Definition: SelectionDAGNodes.h:556
llvm::Data
@ Data
Definition: SIMachineScheduler.h:55
llvm::PointerUnion::get
T get() const
Returns the value of the specified pointer type.
Definition: PointerUnion.h:144
llvm::SDUse::SDUse
SDUse()=default
p
the resulting code requires compare and branches when and if * p
Definition: README.txt:396
llvm::SDUse::get
const SDValue & get() const
If implicit conversion to SDValue doesn't work, the get() method returns the SDValue.
Definition: SelectionDAGNodes.h:296
llvm::MaskedScatterSDNode::isTruncatingStore
bool isTruncatingStore() const
Return true if the op does a truncation before store.
Definition: SelectionDAGNodes.h:2749
llvm::VPScatterSDNode::getValue
const SDValue & getValue() const
Definition: SelectionDAGNodes.h:2654
llvm::ConstantSDNode::getConstantIntValue
const ConstantInt * getConstantIntValue() const
Definition: SelectionDAGNodes.h:1571
llvm::ISD::ATOMIC_LOAD_OR
@ ATOMIC_LOAD_OR
Definition: ISDOpcodes.h:1148
llvm::SDUse::getResNo
unsigned getResNo() const
Convenience function for get().getResNo().
Definition: SelectionDAGNodes.h:307
llvm::RISCVFenceField::R
@ R
Definition: RISCVBaseInfo.h:207
llvm::SDNode::getVTList
SDVTList getVTList() const
Definition: SelectionDAGNodes.h:934
llvm::ConstantSDNode::getLimitedValue
uint64_t getLimitedValue(uint64_t Limit=UINT64_MAX)
Definition: SelectionDAGNodes.h:1575
llvm::MDNodeSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2112
llvm::MemSDNode::isUnordered
bool isUnordered() const
Returns true if the memory operation doesn't imply any ordering constraints on surrounding memory ope...
Definition: SelectionDAGNodes.h:1332
llvm::ShuffleVectorSDNode
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
Definition: SelectionDAGNodes.h:1500
llvm::FPMathOperator::hasNoInfs
bool hasNoInfs() const
Test if this operation's arguments and results are assumed not-infinite.
Definition: Operator.h:357
llvm::MaskedLoadStoreSDNode::isIndexed
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
Definition: SelectionDAGNodes.h:2499
llvm::ConstantFPSDNode::isNaN
bool isNaN() const
Return true if the value is a NaN.
Definition: SelectionDAGNodes.h:1625
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:58
llvm::ISD::PSEUDO_PROBE
@ PSEUDO_PROBE
Pseudo probe for AutoFDO, as a place holder in a basic block to improve the sample counts quality.
Definition: ISDOpcodes.h:1201
llvm::SDNodeIterator::begin
static SDNodeIterator begin(const SDNode *N)
Definition: SelectionDAGNodes.h:2874
MachineValueType.h
llvm::SDNode::value_begin
value_iterator value_begin() const
Definition: SelectionDAGNodes.h:989
llvm::SDNodeFlags::setApproximateFuncs
void setApproximateFuncs(bool b)
Definition: SelectionDAGNodes.h:418
llvm::MaskedLoadSDNode::getPassThru
const SDValue & getPassThru() const
Definition: SelectionDAGNodes.h:2530
llvm::MaskedGatherSDNode::getPassThru
const SDValue & getPassThru() const
Definition: SelectionDAGNodes.h:2721
GraphTraits.h
llvm::ConstantFPSDNode::isValueValidForType
static bool isValueValidForType(EVT VT, const APFloat &Val)
Definition: SelectionDAG.cpp:125
llvm::SDNode::op_end
op_iterator op_end() const
Definition: SelectionDAGNodes.h:914
llvm::SDNodeFlags::copyFMF
void copyFMF(const FPMathOperator &FPMO)
Propagate the fast-math-flags from an IR FPMathOperator.
Definition: SelectionDAGNodes.h:399
llvm::MaskedLoadStoreSDNode
This base class is used to represent MLOAD and MSTORE nodes.
Definition: SelectionDAGNodes.h:2469
llvm::SDNode::SDNode
SDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs)
Create an SDNode.
Definition: SelectionDAGNodes.h:1066
llvm::MachineMemOperand::getPointerInfo
const MachinePointerInfo & getPointerInfo() const
Definition: MachineMemOperand.h:202
llvm::MemSDNode::isInvariant
bool isInvariant() const
Definition: SelectionDAGNodes.h:1300
Instruction.h
llvm::ISD::LoadExtType
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
Definition: ISDOpcodes.h:1350
LHS
Value * LHS
Definition: X86PartialReduction.cpp:73
llvm::BlockAddressSDNode::getOffset
int64_t getOffset() const
Definition: SelectionDAGNodes.h:2165
llvm::HandleSDNode::getValue
const SDValue & getValue() const
Definition: SelectionDAGNodes.h:1235
llvm::ConstantInt
This is the shared class of boolean and integer constants.
Definition: Constants.h:79
llvm::DenseMapInfo
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition: APInt.h:34
llvm::SDNode::getOpcode
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
Definition: SelectionDAGNodes.h:628
llvm::AMDGPU::TargetIndex
TargetIndex
Definition: AMDGPU.h:338
llvm::SDNode::LoadSDNodeBits
LoadSDNodeBitfields LoadSDNodeBits
Definition: SelectionDAGNodes.h:561
llvm::StoreSDNode::setTruncatingStore
void setTruncatingStore(bool Truncating)
Definition: SelectionDAGNodes.h:2345
llvm::JumpTableSDNode::getTargetFlags
unsigned getTargetFlags() const
Definition: SelectionDAGNodes.h:1836
llvm::SDNode::SDNodeBits
SDNodeBitfields SDNodeBits
Definition: SelectionDAGNodes.h:557
llvm::ISD::GlobalAddress
@ GlobalAddress
Definition: ISDOpcodes.h:78
llvm::ExternalSymbolSDNode
Definition: SelectionDAGNodes.h:2193
llvm::SDValue::getValueType
EVT getValueType() const
Return the ValueType of the referenced return value.
Definition: SelectionDAGNodes.h:1123
llvm::SDValue::operator!=
bool operator!=(const SDValue &O) const
Definition: SelectionDAGNodes.h:161
llvm::MemIntrinsicSDNode
This SDNode is used for target intrinsics that touch memory and need an associated MachineMemOperand.
Definition: SelectionDAGNodes.h:1474
llvm::MutableArrayRef
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Definition: ArrayRef.h:305
llvm::SelectionDAG
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
Definition: SelectionDAG.h:216
Constants.h
llvm::MachineMemOperand::getBaseAlign
Align getBaseAlign() const
Return the minimum known alignment in bytes of the base address, without the offset.
Definition: MachineMemOperand.h:255
llvm::LoadSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2322
llvm::SDNode::hasOneUse
bool hasOneUse() const
Return true if there is exactly one use of this node.
Definition: SelectionDAGNodes.h:702
llvm::SDNode::areOnlyUsersOf
static bool areOnlyUsersOf(ArrayRef< const SDNode * > Nodes, const SDNode *N)
Return true if all the users of N are contained in Nodes.
Definition: SelectionDAG.cpp:10199
llvm::ISD::Constant
@ Constant
Definition: ISDOpcodes.h:76
llvm::ISD::isBuildVectorOfConstantFPSDNodes
bool isBuildVectorOfConstantFPSDNodes(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR node of all ConstantFPSDNode or undef.
Definition: SelectionDAG.cpp:284
llvm::SmallVectorImpl::append
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:657
llvm::SDValue::reachesChainWithoutSideEffects
bool reachesChainWithoutSideEffects(SDValue Dest, unsigned Depth=2) const
Return true if this operand (which must be a chain) reaches the specified operand without crossing an...
Definition: SelectionDAG.cpp:10231
llvm::BuildVectorSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2073
llvm::User
Definition: User.h:44
llvm::SDNode::setFlags
void setFlags(SDNodeFlags NewFlags)
Definition: SelectionDAGNodes.h:958
llvm::EVT
Extended Value Type.
Definition: ValueTypes.h:35
llvm::MemSDNode::isDereferenceable
bool isDereferenceable() const
Definition: SelectionDAGNodes.h:1299
llvm::SDValue::operator==
bool operator==(const SDValue &O) const
Definition: SelectionDAGNodes.h:158
llvm::SDNodeIterator::operator++
SDNodeIterator operator++(int)
Definition: SelectionDAGNodes.h:2865
llvm::SDNode::isStrictFPOpcode
bool isStrictFPOpcode()
Test if this node is a strict floating point pseudo-op.
Definition: SelectionDAGNodes.h:665
llvm::JumpTableSDNode
Definition: SelectionDAGNodes.h:1823
llvm::EVT::getVectorNumElements
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
Definition: ValueTypes.h:309
llvm::AtomicSDNode::getFailureOrdering
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur.
Definition: SelectionDAGNodes.h:1442
llvm::VPScatterSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2656
llvm::ISD::STRICT_FP16_TO_FP
@ STRICT_FP16_TO_FP
Definition: ISDOpcodes.h:864
llvm::MaskedLoadStoreSDNode::MaskedLoadStoreSDNode
MaskedLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT, MachineMemOperand *MMO)
Definition: SelectionDAGNodes.h:2473
llvm::MemIntrinsicSDNode::MemIntrinsicSDNode
MemIntrinsicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemoryVT, MachineMemOperand *MMO)
Definition: SelectionDAGNodes.h:1476
llvm::BasicBlockSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1943
llvm::SDLoc::getIROrder
unsigned getIROrder() const
Definition: SelectionDAGNodes.h:1103
b
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int b
Definition: README.txt:418
llvm::MemSDNode::getRawSubclassData
unsigned getRawSubclassData() const
Return the SubclassData value, without HasDebugValue.
Definition: SelectionDAGNodes.h:1284
llvm::SDNode::dumprWithDepth
void dumprWithDepth(const SelectionDAG *G=nullptr, unsigned depth=100) const
printrWithDepth to dbgs().
Definition: SelectionDAGDumper.cpp:1038
llvm::TargetIndexSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1923
llvm::MaskedGatherScatterSDNode::setIndexType
void setIndexType(ISD::MemIndexType IndexType)
Definition: SelectionDAGNodes.h:2680
llvm::MaskedGatherScatterSDNode::MaskedGatherScatterSDNode
MaskedGatherScatterSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType)
Definition: SelectionDAGNodes.h:2668
llvm::isIntOrFPConstant
bool isIntOrFPConstant(SDValue V)
Return true if V is either a integer or FP constant.
Definition: SelectionDAGNodes.h:1716
llvm::VPScatterSDNode
This class is used to represent an VP_SCATTER node.
Definition: SelectionDAGNodes.h:2645
UINT64_MAX
#define UINT64_MAX
Definition: DataTypes.h:77
llvm::FrameIndexSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1759
llvm::simplify_type
Definition: ilist_iterator.h:178
false
Definition: StackSlotColoring.cpp:142
llvm::SrcValueSDNode::getValue
const Value * getValue() const
Return the contained Value.
Definition: SelectionDAGNodes.h:2093
llvm::MaybeAlign
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Definition: Alignment.h:109
llvm::SDNode::ConstantSDNodeBitfields
Definition: SelectionDAGNodes.h:487
llvm::ShuffleVectorSDNode::isSplat
bool isSplat() const
Definition: SelectionDAGNodes.h:1522
llvm::ISD::NodeType
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
Definition: ISDOpcodes.h:40
llvm::ISD::isUNINDEXEDLoad
bool isUNINDEXEDLoad(const SDNode *N)
Returns true if the specified node is an unindexed load.
Definition: SelectionDAGNodes.h:2944
llvm::SDNodeFlags::setExact
void setExact(bool b)
Definition: SelectionDAGNodes.h:412
llvm::ISD::ADDRSPACECAST
@ ADDRSPACECAST
ADDRSPACECAST - This operator converts between pointers of different address spaces.
Definition: ISDOpcodes.h:856
llvm::SDNode::uses
iterator_range< use_iterator > uses()
Definition: SelectionDAGNodes.h:791
llvm::SDNode::NumSDNodeBits
@ NumSDNodeBits
Definition: SelectionDAGNodes.h:485
llvm::ISD::ATOMIC_LOAD_AND
@ ATOMIC_LOAD_AND
Definition: ISDOpcodes.h:1146
llvm::SDNode::use_iterator::operator++
use_iterator & operator++()
Definition: SelectionDAGNodes.h:757
llvm::StoreSDNode::getOffset
const SDValue & getOffset() const
Definition: SelectionDAGNodes.h:2351
llvm::RegisterSDNode::getReg
Register getReg() const
Definition: SelectionDAGNodes.h:2126
llvm::MaskedLoadSDNode::getBasePtr
const SDValue & getBasePtr() const
Definition: SelectionDAGNodes.h:2527
llvm::MaskedStoreSDNode::getMask
const SDValue & getMask() const
Definition: SelectionDAGNodes.h:2566
llvm::Instruction
Definition: Instruction.h:45
llvm::rdf::NodeId
uint32_t NodeId
Definition: RDFGraph.h:260
llvm::ISD::MDNODE_SDNODE
@ MDNODE_SDNODE
MDNODE_SDNODE - This is a node that holdes an MDNode*, which is used to reference metadata in the IR.
Definition: ISDOpcodes.h:1061
llvm::ISD::ATOMIC_LOAD_UMIN
@ ATOMIC_LOAD_UMIN
Definition: ISDOpcodes.h:1153
llvm::LabelSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2187
llvm::ShuffleVectorSDNode::getMask
ArrayRef< int > getMask() const
Definition: SelectionDAGNodes.h:1512
llvm::peekThroughOneUseBitcasts
SDValue peekThroughOneUseBitcasts(SDValue V)
Return the non-bitcasted and one-use source operand of V if it exists.
Definition: SelectionDAG.cpp:9948
llvm::SDNodeIterator::operator==
bool operator==(const SDNodeIterator &x) const
Definition: SelectionDAGNodes.h:2851
llvm::BuildVectorSDNode::getSplatValue
SDValue getSplatValue(const APInt &DemandedElts, BitVector *UndefElements=nullptr) const
Returns the demanded splatted value or a null value if this is not a splat.
Definition: SelectionDAG.cpp:10764
llvm::SDNode::use_empty
bool use_empty() const
Return true if there are no uses of this node.
Definition: SelectionDAGNodes.h:699
llvm::DenseMapInfo< SDValue >::getHashValue
static unsigned getHashValue(const SDValue &Val)
Definition: SelectionDAGNodes.h:244
llvm::SDNode::isTargetOpcode
bool isTargetOpcode() const
Test if this node has a target-specific opcode (in the <target>ISD namespace).
Definition: SelectionDAGNodes.h:632
llvm::ISD::isBuildVectorOfConstantSDNodes
bool isBuildVectorOfConstantSDNodes(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR node of all ConstantSDNode or undef.
Definition: SelectionDAG.cpp:271
llvm::VPStoreSDNode::getBasePtr
const SDValue & getBasePtr() const
Definition: SelectionDAGNodes.h:2458
llvm::isOneOrOneSplat
bool isOneOrOneSplat(SDValue V, bool AllowUndefs=false)
Return true if the value is a constant 1 integer or a splatted vector of a constant 1 integer (with n...
Definition: SelectionDAG.cpp:10071
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::ConstantFP
ConstantFP - Floating Point Values [float, double].
Definition: Constants.h:257
llvm::MaskedStoreSDNode::getValue
const SDValue & getValue() const
Definition: SelectionDAGNodes.h:2563
APFloat.h
This file declares a class to represent arbitrary precision floating point values and provide a varie...
llvm::ISD::ATOMIC_STORE
@ ATOMIC_STORE
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
Definition: ISDOpcodes.h:1122
llvm::LSBaseSDNode::isUnindexed
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
Definition: SelectionDAGNodes.h:2291
llvm::FrameIndexSDNode
Definition: SelectionDAGNodes.h:1746
BitVector.h
llvm::ConstantSDNode::isMinSignedValue
bool isMinSignedValue() const
Definition: SelectionDAGNodes.h:1589
llvm::MaskedGatherSDNode::MaskedGatherSDNode
MaskedGatherSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType, ISD::LoadExtType ETy)
Definition: SelectionDAGNodes.h:2713
llvm::ISD::AssertAlign
@ AssertAlign
AssertAlign - These nodes record if a register contains a value that has a known alignment and the tr...
Definition: ISDOpcodes.h:68
DebugLoc.h
SmallPtrSet.h
llvm::SDNode::value_op_iterator::value_op_iterator
value_op_iterator(SDUse *U=nullptr)
Definition: SelectionDAGNodes.h:923
llvm::LabelSDNode
Definition: SelectionDAGNodes.h:2174
llvm::BitVector
Definition: BitVector.h:74
llvm::CondCodeSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2242
llvm::ISD::SMULO
@ SMULO
Same for multiplication.
Definition: ISDOpcodes.h:318
llvm::ISD::UNSIGNED_SCALED
@ UNSIGNED_SCALED
Definition: ISDOpcodes.h:1334
llvm::MemSDNode::isNonTemporal
bool isNonTemporal() const
Definition: SelectionDAGNodes.h:1298
llvm::ISD::TargetGlobalAddress
@ TargetGlobalAddress
TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or anything else with this node...
Definition: ISDOpcodes.h:164
Align
uint64_t Align
Definition: ELFObjHandler.cpp:82
llvm::MaskedScatterSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2753
llvm::GlobalAddressSDNode::getGlobal
const GlobalValue * getGlobal() const
Definition: SelectionDAGNodes.h:1732
llvm::MaskedLoadStoreSDNode::isUnindexed
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
Definition: SelectionDAGNodes.h:2502
llvm::FPMathOperator::hasNoSignedZeros
bool hasNoSignedZeros() const
Test if this operation can ignore the sign of zero.
Definition: Operator.h:362
llvm::ConstantSDNode::isOne
bool isOne() const
Definition: SelectionDAGNodes.h:1581
llvm::ISD::UNINDEXED
@ UNINDEXED
Definition: ISDOpcodes.h:1319
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::DenseMapInfo< SDValue >::getEmptyKey
static SDValue getEmptyKey()
Definition: SelectionDAGNodes.h:232
llvm::SDValue::getConstantOperandVal
uint64_t getConstantOperandVal(unsigned i) const
Definition: SelectionDAGNodes.h:1135
force
therefore end up llgh r3 lr r0 br r14 but truncating the load would lh r3 br r14 Functions ret i64 and ought to be implemented ngr r0 br r14 but two address optimizations reverse the order of the AND and force
Definition: README.txt:112
c
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int int c
Definition: README.txt:418
llvm::SDValue::getValueSizeInBits
TypeSize getValueSizeInBits() const
Returns the size of the value in bits.
Definition: SelectionDAGNodes.h:191
llvm::LSBaseSDNode::getOffset
const SDValue & getOffset() const
Definition: SelectionDAGNodes.h:2277
llvm::ISD::USUBO
@ USUBO
Definition: ISDOpcodes.h:315
llvm::MemSDNode::isVolatile
bool isVolatile() const
Definition: SelectionDAGNodes.h:1297
llvm::MachineMemOperand::getSyncScopeID
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID for this memory operation.
Definition: MachineMemOperand.h:264
llvm::StoreSDNode::isTruncatingStore
bool isTruncatingStore() const
Return true if the op does a truncation before store.
Definition: SelectionDAGNodes.h:2344
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
llvm::RegisterMaskSDNode
Definition: SelectionDAGNodes.h:2133
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
llvm::ISD::VALUETYPE
@ VALUETYPE
Definition: ISDOpcodes.h:72
llvm::TargetIndexSDNode::getTargetFlags
unsigned getTargetFlags() const
Definition: SelectionDAGNodes.h:1919
llvm::SDNode::setDebugLoc
void setDebugLoc(DebugLoc dl)
Set source location info.
Definition: SelectionDAGNodes.h:725
llvm::MachineSDNode::memoperands
ArrayRef< MachineMemOperand * > memoperands() const
Definition: SelectionDAGNodes.h:2797
llvm::ISD::ATOMIC_LOAD_FADD
@ ATOMIC_LOAD_FADD
Definition: ISDOpcodes.h:1155
llvm::SDNode::value_op_iterator
Iterator for directly iterating over the operand SDValue's.
Definition: SelectionDAGNodes.h:918
llvm::ISD::TargetConstantFP
@ TargetConstantFP
Definition: ISDOpcodes.h:159
llvm::SDLoc::SDLoc
SDLoc(const SDValue V)
Definition: SelectionDAGNodes.h:1096
llvm::BlockAddressSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2168
llvm::VTSDNode::getVT
EVT getVT() const
Definition: SelectionDAGNodes.h:2259
llvm::SDNode::getGluedUser
SDNode * getGluedUser() const
If this node has a glue value with a user, return the user (there is at most one).
Definition: SelectionDAGNodes.h:950
llvm::MaskedScatterSDNode::MaskedScatterSDNode
MaskedScatterSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType, bool IsTrunc)
Definition: SelectionDAGNodes.h:2738
Node::dump
DEMANGLE_DUMP_METHOD void dump() const
llvm::MaskedLoadStoreSDNode::getOffset
const SDValue & getOffset() const
Definition: SelectionDAGNodes.h:2485
llvm::SDNodeIterator::operator++
SDNodeIterator & operator++()
Definition: SelectionDAGNodes.h:2861
llvm::ISD::BlockAddress
@ BlockAddress
Definition: ISDOpcodes.h:84
llvm::checkForCycles
void checkForCycles(const SelectionDAG *DAG, bool force=false)
Definition: SelectionDAG.cpp:11165
llvm::SDNode::MemSDNodeBitfields
Definition: SelectionDAGNodes.h:495
llvm::AssertAlignSDNode
An SDNode that records if a register contains a value that is guaranteed to be aligned accordingly.
Definition: SelectionDAGNodes.h:2824
G
const DataFlowGraph & G
Definition: RDFGraph.cpp:202
llvm::AtomicOrdering
AtomicOrdering
Atomic ordering for LLVM's memory model.
Definition: AtomicOrdering.h:56
llvm::VPLoadStoreSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2400
llvm::ISD::matchUnaryPredicate
bool matchUnaryPredicate(SDValue Op, std::function< bool(ConstantSDNode *)> Match, bool AllowUndefs=false)
Attempt to match a unary predicate against a scalar/splat constant or every element of a constant BUI...
Definition: SelectionDAG.cpp:306
llvm::MaskedScatterSDNode::getValue
const SDValue & getValue() const
Definition: SelectionDAGNodes.h:2751
val
The initial backend is deliberately restricted to z10 We should add support for later architectures at some point If an asm ties an i32 r result to an i64 the input will be treated as an leaving the upper bits uninitialised For i64 store i32 val
Definition: README.txt:15
llvm::APFloat
Definition: APFloat.h:701
llvm::SDNode::use_begin
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
Definition: SelectionDAGNodes.h:785
llvm::ISD::Register
@ Register
Definition: ISDOpcodes.h:74
llvm::ISD::isVPOpcode
bool isVPOpcode(unsigned Opcode)
Whether this is a vector-predicated Opcode.
Definition: SelectionDAG.cpp:420
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:206
llvm::SDValue::getNumOperands
unsigned getNumOperands() const
Definition: SelectionDAGNodes.h:1127
llvm::isNullFPConstant
bool isNullFPConstant(SDValue V)
Returns true if V is an FP constant with a value of positive zero.
Definition: SelectionDAG.cpp:9927
llvm::ISD::SADDO
@ SADDO
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
Definition: ISDOpcodes.h:310
llvm::SDUse::getNext
SDUse * getNext() const
Get the next SDUse in the use list.
Definition: SelectionDAGNodes.h:302
llvm::VPGatherScatterSDNode::getIndexType
ISD::MemIndexType getIndexType() const
How is Index applied to BasePtr when computing addresses.
Definition: SelectionDAGNodes.h:2589
llvm::peekThroughBitcasts
SDValue peekThroughBitcasts(SDValue V)
Return the non-bitcasted source operand of V if it exists.
Definition: SelectionDAG.cpp:9942
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::BuildVectorSDNode::getConstantFPSplatNode
ConstantFPSDNode * getConstantFPSplatNode(const APInt &DemandedElts, BitVector *UndefElements=nullptr) const
Returns the demanded splatted constant FP or null if this is not a constant FP splat.
Definition: SelectionDAG.cpp:10869
llvm::StoreSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2353
llvm::VPGatherScatterSDNode::getScale
const SDValue & getScale() const
Definition: SelectionDAGNodes.h:2611
llvm::isNullOrNullSplat
bool isNullOrNullSplat(SDValue V, bool AllowUndefs=false)
Return true if the value is a constant 0 integer or a splatted vector of a constant 0 integer (with n...
Definition: SelectionDAG.cpp:10064
llvm::EVT::getSizeInBits
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
Definition: ValueTypes.h:341
Index
uint32_t Index
Definition: ELFObjHandler.cpp:83
uint64_t
llvm::ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS
@ ATOMIC_CMP_SWAP_WITH_SUCCESS
Val, Success, OUTCHAIN = ATOMIC_CMP_SWAP_WITH_SUCCESS(INCHAIN, ptr, cmp, swap) N.b.
Definition: ISDOpcodes.h:1135
llvm::ISD::ATOMIC_LOAD_MIN
@ ATOMIC_LOAD_MIN
Definition: ISDOpcodes.h:1151
llvm::MemSDNode::refineAlignment
void refineAlignment(const MachineMemOperand *NewMMO)
Update this MemSDNode's MachineMemOperand information to reflect the alignment of NewMMO,...
Definition: SelectionDAGNodes.h:1357
llvm::RegisterSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2128
llvm::LifetimeSDNode
This SDNode is used for LIFETIME_START/LIFETIME_END values, which indicate the offet and size that ar...
Definition: SelectionDAGNodes.h:1767
llvm::ConstantFPSDNode
Definition: SelectionDAGNodes.h:1607
llvm::MemSDNode::getMemOperand
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
Definition: SelectionDAGNodes.h:1342
llvm::ISD::FIRST_TARGET_STRICTFP_OPCODE
static const int FIRST_TARGET_STRICTFP_OPCODE
FIRST_TARGET_STRICTFP_OPCODE - Target-specific pre-isel operations which cannot raise FP exceptions s...
Definition: ISDOpcodes.h:1259
const
aarch64 promote const
Definition: AArch64PromoteConstant.cpp:232
llvm::ISD::LOAD
@ LOAD
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
Definition: ISDOpcodes.h:925
llvm::SDUse::getValueType
EVT getValueType() const
Convenience function for get().getValueType().
Definition: SelectionDAGNodes.h:309
llvm::ConstantPoolSDNode::getType
Type * getType() const
Definition: SelectionDAG.cpp:10692
llvm::SDNode::print_details
void print_details(raw_ostream &OS, const SelectionDAG *G) const
Definition: SelectionDAGDumper.cpp:557
llvm::SDNode::hasPredecessor
bool hasPredecessor(const SDNode *N) const
Return true if N is a predecessor of this node.
Definition: SelectionDAG.cpp:10269
llvm::SDValue::isTargetMemoryOpcode
bool isTargetMemoryOpcode() const
Definition: SelectionDAGNodes.h:1147
llvm::ISD::SRCVALUE
@ SRCVALUE
SRCVALUE - This is a node type that holds a Value* that is used to make reference to a value in the L...
Definition: ISDOpcodes.h:1057
llvm::VPLoadSDNode
This class is used to represent a VP_LOAD node.
Definition: SelectionDAGNodes.h:2406
llvm::MaskedStoreSDNode::isTruncatingStore
bool isTruncatingStore() const
Return true if the op does a truncation before store.
Definition: SelectionDAGNodes.h:2555
llvm::ConstantSDNode::getMaybeAlignValue
MaybeAlign getMaybeAlignValue() const
Definition: SelectionDAGNodes.h:1578
llvm::FPMathOperator::hasAllowReciprocal
bool hasAllowReciprocal() const
Test if this operation can use reciprocal multiply instead of division.
Definition: Operator.h:367
llvm::MachinePointerInfo
This class contains a discriminated union of information about pointers in memory operands,...
Definition: MachineMemOperand.h:38
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::BuildVectorSDNode::BuildVectorSDNode
BuildVectorSDNode()=delete
llvm::ISD::isConstantSplatVector
bool isConstantSplatVector(const SDNode *N, APInt &SplatValue)
Node predicates.
Definition: SelectionDAG.cpp:142
llvm::numbers::e
constexpr double e
Definition: MathExtras.h:57
llvm::SDNode::setNodeId
void setNodeId(int Id)
Set unique node id.
Definition: SelectionDAGNodes.h:712
llvm::SDNode::NumLSBaseSDNodeBits
@ NumLSBaseSDNodeBits
Definition: SelectionDAGNodes.h:527
llvm::VPGatherScatterSDNode::getMask
const SDValue & getMask() const
Definition: SelectionDAGNodes.h:2614
llvm::SDLoc::getDebugLoc
const DebugLoc & getDebugLoc() const
Definition: SelectionDAGNodes.h:1104
llvm::SyncScope::ID
uint8_t ID
Definition: LLVMContext.h:46
llvm::SDNode::LSBaseSDNodeBitfields
Definition: SelectionDAGNodes.h:509
llvm::MaskedGatherScatterSDNode::isIndexScaled
bool isIndexScaled() const
Definition: SelectionDAGNodes.h:2683
llvm::ISD::ATOMIC_LOAD_NAND
@ ATOMIC_LOAD_NAND
Definition: ISDOpcodes.h:1150
llvm::SDNode::getOperand
const SDValue & getOperand(unsigned Num) const
Definition: SelectionDAGNodes.h:906
llvm::MaskedStoreSDNode::MaskedStoreSDNode
MaskedStoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, bool isTrunc, bool isCompressing, EVT MemVT, MachineMemOperand *MMO)
Definition: SelectionDAGNodes.h:2544
iterator.h
llvm::MaskedLoadSDNode::isExpandingLoad
bool isExpandingLoad() const
Definition: SelectionDAGNodes.h:2536
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::FrameIndexSDNode::getIndex
int getIndex() const
Definition: SelectionDAGNodes.h:1757
llvm::VPLoadStoreSDNode::VPLoadStoreSDNode
VPLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT, MachineMemOperand *MMO)
Definition: SelectionDAGNodes.h:2363
llvm::SDNode::use_iterator::getUse
SDUse & getUse() const
Definition: SelectionDAGNodes.h:775
llvm::SDNodeIterator::operator*
pointer operator*() const
Definition: SelectionDAGNodes.h:2856
llvm::SDNodeFlags::setAllowReciprocal
void setAllowReciprocal(bool b)
Definition: SelectionDAGNodes.h:416
llvm::BuildVectorSDNode::recastRawBits
static void recastRawBits(bool IsLittleEndian, unsigned DstEltSizeInBits, SmallVectorImpl< APInt > &DstBitElements, ArrayRef< APInt > SrcBitElements, BitVector &DstUndefElements, const BitVector &SrcUndefElements)
Recast bit data SrcBitElements to DstEltSizeInBits wide elements.
Definition: SelectionDAG.cpp:10935
Attributes
AMDGPU Kernel Attributes
Definition: AMDGPULowerKernelAttributes.cpp:254
llvm::CondCodeSDNode
Definition: SelectionDAGNodes.h:2230
llvm::ISD::ATOMIC_CMP_SWAP
@ ATOMIC_CMP_SWAP
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo,...
Definition: ISDOpcodes.h:1129
node
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper node
Definition: README-SSE.txt:406
llvm::ISD::ATOMIC_LOAD_ADD
@ ATOMIC_LOAD_ADD
Definition: ISDOpcodes.h:1144
llvm::SDNode::use_iterator::difference_type
std::ptrdiff_t difference_type
Definition: SelectionDAGNodes.h:739
llvm::LoadSDNode::getExtensionType
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
Definition: SelectionDAGNodes.h:2315
llvm::SDNode::dump
void dump() const
Dump this node, for debugging.
Definition: SelectionDAGDumper.cpp:539
llvm::BasicBlockSDNode
Definition: SelectionDAGNodes.h:1928
llvm::MemSDNode::getOriginalAlign
Align getOriginalAlign() const
Returns alignment and volatility of the memory access.
Definition: SelectionDAGNodes.h:1273
ArrayRef.h
llvm::MachineSDNode::mmo_iterator
ArrayRef< MachineMemOperand * >::const_iterator mmo_iterator
Definition: SelectionDAGNodes.h:2795
llvm::SDValue::getScalarValueSizeInBits
uint64_t getScalarValueSizeInBits() const
Definition: SelectionDAGNodes.h:195
TemplateParamKind::Type
@ Type
llvm::SDNode::ConstantSDNodeBits
ConstantSDNodeBitfields ConstantSDNodeBits
Definition: SelectionDAGNodes.h:558
END_TWO_BYTE_PACK
#define END_TWO_BYTE_PACK()
Definition: SelectionDAGNodes.h:471
llvm::GlobalAddressSDNode::getOffset
int64_t getOffset() const
Definition: SelectionDAGNodes.h:1733
llvm::BlockAddressSDNode::getTargetFlags
unsigned getTargetFlags() const
Definition: SelectionDAGNodes.h:2166
llvm::ISD::MSTORE
@ MSTORE
Definition: ISDOpcodes.h:1165
llvm::JumpTableSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1838
llvm::StoreSDNode
This class is used to represent ISD::STORE nodes.
Definition: SelectionDAGNodes.h:2328
llvm::ISD::ZEXTLOAD
@ ZEXTLOAD
Definition: ISDOpcodes.h:1350
llvm::SDValue::getValue
SDValue getValue(unsigned R) const
Definition: SelectionDAGNodes.h:171
llvm::AMDGPU::HSAMD::ValueType
ValueType
Value types.
Definition: AMDGPUMetadata.h:95
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::SDNodeFlags::hasNoUnsignedWrap
bool hasNoUnsignedWrap() const
Definition: SelectionDAGNodes.h:423
llvm::FPMathOperator::hasAllowReassoc
bool hasAllowReassoc() const
Test if this operation may be simplified with reassociative transforms.
Definition: Operator.h:347
llvm::FPMathOperator
Utility class for floating point operations which can have information about relaxed accuracy require...
Definition: Operator.h:265
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1707
llvm::LifetimeSDNode::getOffset
int64_t getOffset() const
Definition: SelectionDAGNodes.h:1781
llvm::SDNode::getNodeId
int getNodeId() const
Return the unique node id.
Definition: SelectionDAGNodes.h:709
llvm::SDLoc::SDLoc
SDLoc(const Instruction *I, int Order)
Definition: SelectionDAGNodes.h:1097
memcpy
<%struct.s * > cast struct s *S to sbyte *< sbyte * > sbyte uint cast struct s *agg result to sbyte *< sbyte * > sbyte uint cast struct s *memtmp to sbyte *< sbyte * > sbyte uint ret void llc ends up issuing two memcpy or custom lower memcpy(of small size) to be ldmia/stmia. I think option 2 is better but the current register allocator cannot allocate a chunk of registers at a time. A feasible temporary solution is to use specific physical registers at the lowering time for small(<
llvm::ConstantSDNode::getZExtValue
uint64_t getZExtValue() const
Definition: SelectionDAGNodes.h:1573
llvm::SDValue::getResNo
unsigned getResNo() const
get the index which selects a specific result in the SDNode
Definition: SelectionDAGNodes.h:148
llvm::SDNode::print
void print(raw_ostream &OS, const SelectionDAG *G=nullptr) const
Definition: SelectionDAGDumper.cpp:1048
llvm::MaskedLoadSDNode
This class is used to represent an MLOAD node.
Definition: SelectionDAGNodes.h:2511
llvm::MachineMemOperand::getSuccessOrdering
AtomicOrdering getSuccessOrdering() const
Return the atomic ordering requirements for this memory operation.
Definition: MachineMemOperand.h:271
llvm::MCSymbolSDNode
Definition: SelectionDAGNodes.h:2214
llvm::ISD::CondCode
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
Definition: ISDOpcodes.h:1370
llvm::MaskedStoreSDNode::getOffset
const SDValue & getOffset() const
Definition: SelectionDAGNodes.h:2565
iterator_range.h
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition: ISDOpcodes.h:71
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:83
llvm::MemSDNode::MemSDNode
MemSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT memvt, MachineMemOperand *MMO)
Definition: SelectionDAG.cpp:10103
llvm::ExternalSymbolSDNode::getTargetFlags
unsigned getTargetFlags() const
Definition: SelectionDAGNodes.h:2206
llvm::ISD::ATOMIC_LOAD_FSUB
@ ATOMIC_LOAD_FSUB
Definition: ISDOpcodes.h:1156
llvm::ISD::TargetGlobalTLSAddress
@ TargetGlobalTLSAddress
Definition: ISDOpcodes.h:165
llvm::DenseMapInfo< SDValue >::getTombstoneKey
static SDValue getTombstoneKey()
Definition: SelectionDAGNodes.h:238
llvm::MVT
Machine Value Type.
Definition: MachineValueType.h:31
llvm::ISD::isNON_EXTLoad
bool isNON_EXTLoad(const SDNode *N)
Returns true if the specified node is a non-extending load.
Definition: SelectionDAGNodes.h:2920
llvm::SDNode::use_iterator::operator==
bool operator==(const use_iterator &x) const
Definition: SelectionDAGNodes.h:746
llvm::SDNode::dumpr
void dumpr() const
Dump (recursively) this node and its use-def subgraph.
Definition: SelectionDAGDumper.cpp:996
llvm::SDLoc::SDLoc
SDLoc(const SDNode *N)
Definition: SelectionDAGNodes.h:1095
llvm::SDVTList::VTs
const EVT * VTs
Definition: SelectionDAGNodes.h:79
llvm::MDNode
Metadata node.
Definition: Metadata.h:906
llvm::ShuffleVectorSDNode::ShuffleVectorSDNode
ShuffleVectorSDNode(EVT VT, unsigned Order, const DebugLoc &dl, const int *M)
Definition: SelectionDAGNodes.h:1508
llvm::SDNode::getSimpleValueType
MVT getSimpleValueType(unsigned ResNo) const
Return the type of a specified result as a simple type.
Definition: SelectionDAGNodes.h:974
llvm::StoreSDNode::getValue
const SDValue & getValue() const
Definition: SelectionDAGNodes.h:2349
llvm::SDNode::getValueSizeInBits
TypeSize getValueSizeInBits(unsigned ResNo) const
Returns MVT::getSizeInBits(getValueType(ResNo)).
Definition: SelectionDAGNodes.h:983
llvm::SDNodeFlags::setNoInfs
void setNoInfs(bool b)
Definition: SelectionDAGNodes.h:414
llvm::AssertAlignSDNode::AssertAlignSDNode
AssertAlignSDNode(unsigned Order, const DebugLoc &DL, EVT VT, Align A)
Definition: SelectionDAGNodes.h:2828
llvm::DebugLoc::hasTrivialDestructor
bool hasTrivialDestructor() const
Check whether this has a trivial destructor.
Definition: DebugLoc.h:69
llvm::SmallPtrSetImpl::count
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
Definition: SmallPtrSet.h:382
llvm::FPMathOperator::hasApproxFunc
bool hasApproxFunc() const
Test if this operation allows approximations of math library functions or intrinsics.
Definition: Operator.h:378
llvm::SDNode::isMachineOpcode
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode.
Definition: SelectionDAGNodes.h:683
llvm::ISD::TargetBlockAddress
@ TargetBlockAddress
Definition: ISDOpcodes.h:170
llvm::SDNode::values
iterator_range< value_iterator > values() const
Definition: SelectionDAGNodes.h:991
llvm::APInt
Class for arbitrary precision integers.
Definition: APInt.h:75
llvm::PseudoProbeSDNode::getGuid
uint64_t getGuid() const
Definition: SelectionDAGNodes.h:1813
llvm::ISD::ANNOTATION_LABEL
@ ANNOTATION_LABEL
ANNOTATION_LABEL - Represents a mid basic block label used by annotations.
Definition: ISDOpcodes.h:998
llvm::MDNodeSDNode
Definition: SelectionDAGNodes.h:2100
llvm::ISD::HANDLENODE
@ HANDLENODE
HANDLENODE node - Used as a handle for various purposes.
Definition: ISDOpcodes.h:1075
llvm::ISD::ConstantPool
@ ConstantPool
Definition: ISDOpcodes.h:82
llvm::SDLoc::SDLoc
SDLoc()=default
llvm::hasSingleElement
bool hasSingleElement(ContainerTy &&C)
Returns true if the given container only contains a single element.
Definition: STLExtras.h:314
llvm::LSBaseSDNode::LSBaseSDNode
LSBaseSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT, MachineMemOperand *MMO)
Definition: SelectionDAGNodes.h:2269
ConstantPool
MIPS Relocation Principles In there are several elements of the llvm::ISD::NodeType enum that deal with addresses and or relocations These are defined in include llvm Target TargetSelectionDAG td ConstantPool
Definition: Relocation.txt:6
llvm::SDUse::getUser
SDNode * getUser()
This returns the SDNode that contains this Use.
Definition: SelectionDAGNodes.h:299
llvm::ISD::GlobalTLSAddress
@ GlobalTLSAddress
Definition: ISDOpcodes.h:79
llvm::MemSDNode::getAAInfo
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
Definition: SelectionDAGNodes.h:1306
llvm::BlockAddress
The address of a basic block.
Definition: Constants.h:848
llvm::ISD::TargetConstantPool
@ TargetConstantPool
Definition: ISDOpcodes.h:168
llvm::BuildVectorSDNode::isConstant
bool isConstant() const
Definition: SelectionDAG.cpp:10989
llvm::SDNode::use_iterator::operator->
SDNode * operator->() const
Definition: SelectionDAGNodes.h:773
llvm::MemSDNode::isAtomic
bool isAtomic() const
Return true if the memory operation ordering is Unordered or higher.
Definition: SelectionDAGNodes.h:1327
llvm::LifetimeSDNode::getFrameIndex
int64_t getFrameIndex() const
Definition: SelectionDAGNodes.h:1776
llvm::SDNode::print_types
void print_types(raw_ostream &OS, const SelectionDAG *G) const
Definition: SelectionDAGDumper.cpp:547
llvm::ISD::isSEXTLoad
bool isSEXTLoad(const SDNode *N)
Returns true if the specified node is a SEXTLOAD.
Definition: SelectionDAGNodes.h:2932
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::ISD::isNormalLoad
bool isNormalLoad(const SDNode *N)
Returns true if the specified node is a non-extending and unindexed load.
Definition: SelectionDAGNodes.h:2913
llvm::ConstantPoolSDNode
Definition: SelectionDAGNodes.h:1844
llvm::BlockAddressSDNode::getBlockAddress
const BlockAddress * getBlockAddress() const
Definition: SelectionDAGNodes.h:2164
llvm::SrcValueSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2095
llvm::BuildVectorSDNode::isConstantSplat
bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef, unsigned &SplatBitSize, bool &HasAnyUndefs, unsigned MinSplatBits=0, bool isBigEndian=false) const
Check if this is a constant splat, and if so, find the smallest element size that splats the vector.
Definition: SelectionDAG.cpp:10698
llvm::SDNode::use_end
static use_iterator use_end()
Definition: SelectionDAGNodes.h:789
Cond
SmallVector< MachineOperand, 4 > Cond
Definition: BasicBlockSections.cpp:179
llvm::SDNodeFlags::intersectWith
void intersectWith(const SDNodeFlags Flags)
Clear any flags in this flag set that aren't also set in Flags.
Definition: SelectionDAGNodes.h:437
llvm::HandleSDNode::~HandleSDNode
~HandleSDNode()
Definition: SelectionDAG.cpp:10085
llvm::BuildVectorSDNode
A "pseudo-class" with methods for operating on BUILD_VECTORs.
Definition: SelectionDAGNodes.h:1949
llvm::FoldingSetBase::Node
Node - This class is used to maintain the singly linked bucket list in a folding set.
Definition: FoldingSet.h:133
llvm::SDNodeFlags::setNoFPExcept
void setNoFPExcept(bool b)
Definition: SelectionDAGNodes.h:420
llvm::SDNodeFlags::hasApproximateFuncs
bool hasApproximateFuncs() const
Definition: SelectionDAGNodes.h:431
llvm::ShuffleVectorSDNode::getMaskElt
int getMaskElt(unsigned Idx) const
Definition: SelectionDAGNodes.h:1517
llvm::SDNode::uses
iterator_range< use_iterator > uses() const
Definition: SelectionDAGNodes.h:794
llvm::ConstantPoolSDNode::getConstVal
const Constant * getConstVal() const
Definition: SelectionDAGNodes.h:1879
llvm::ConstantPoolSDNode::getOffset
int getOffset() const
Definition: SelectionDAGNodes.h:1889
llvm::SDValue::getMachineOpcode
unsigned getMachineOpcode() const
Definition: SelectionDAGNodes.h:1155
llvm::VPGatherSDNode
This class is used to represent an VP_GATHER node.
Definition: SelectionDAGNodes.h:2629
llvm::VPGatherScatterSDNode::isIndexSigned
bool isIndexSigned() const
Definition: SelectionDAGNodes.h:2596
llvm::BasicBlockSDNode::getBasicBlock
MachineBasicBlock * getBasicBlock() const
Definition: SelectionDAGNodes.h:1941
llvm::ISD::ATOMIC_LOAD_SUB
@ ATOMIC_LOAD_SUB
Definition: ISDOpcodes.h:1145
llvm::PseudoProbeSDNode::getIndex
uint64_t getIndex() const
Definition: SelectionDAGNodes.h:1814
llvm::SDNode::use_iterator::use_iterator
use_iterator(const use_iterator &I)
Definition: SelectionDAGNodes.h:744
uint32_t
llvm::SDNode::use_iterator::operator++
use_iterator operator++(int)
Definition: SelectionDAGNodes.h:763
llvm::SDNode::isOperandOf
bool isOperandOf(const SDNode *N) const
Return true if this node is an operand of N.
Definition: SelectionDAG.cpp:10216
llvm::MaskedGatherScatterSDNode::getBasePtr
const SDValue & getBasePtr() const
Definition: SelectionDAGNodes.h:2696
llvm::RegisterMaskSDNode::getRegMask
const uint32_t * getRegMask() const
Definition: SelectionDAGNodes.h:2144
llvm::SDValue::getOperand
const SDValue & getOperand(unsigned i) const
Definition: SelectionDAGNodes.h:1131
llvm::SDNode::LSBaseSDNodeBits
LSBaseSDNodeBitfields LSBaseSDNodeBits
Definition: SelectionDAGNodes.h:560
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
BEGIN_TWO_BYTE_PACK
#define BEGIN_TWO_BYTE_PACK()
Definition: SelectionDAGNodes.h:470
llvm::VTSDNode
This class is used to represent EVT's, which are used to parameterize some operations.
Definition: SelectionDAGNodes.h:2249
llvm::isAllOnesOrAllOnesSplat
bool isAllOnesOrAllOnesSplat(SDValue V, bool AllowUndefs=false)
Return true if the value is a constant -1 integer or a splatted vector of a constant -1 integer (with...
Definition: SelectionDAG.cpp:10078
llvm::MaskedStoreSDNode::isCompressingStore
bool isCompressingStore() const
Returns true if the op does a compression to the vector before storing.
Definition: SelectionDAGNodes.h:2561
llvm::SDNode::getIndexedModeName
static const char * getIndexedModeName(ISD::MemIndexedMode AM)
Definition: SelectionDAGDumper.cpp:492
llvm::FoldingSetNodeID
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Definition: FoldingSet.h:313
llvm::ConstantSDNode::getSExtValue
int64_t getSExtValue() const
Definition: SelectionDAGNodes.h:1574
llvm::SDNodeFlags::hasNoInfs
bool hasNoInfs() const
Definition: SelectionDAGNodes.h:427
llvm::ISD::UNDEF
@ UNDEF
UNDEF - An undefined node.
Definition: ISDOpcodes.h:211
llvm::SDValue::hasOneUse
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
Definition: SelectionDAGNodes.h:1167
llvm::ISD::BUILTIN_OP_END
@ BUILTIN_OP_END
BUILTIN_OP_END - This must be the last enum value in this list.
Definition: ISDOpcodes.h:1253
llvm::VPLoadSDNode::getBasePtr
const SDValue & getBasePtr() const
Definition: SelectionDAGNodes.h:2422
llvm::SDValue::getSimpleValueType
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
Definition: SelectionDAGNodes.h:182
llvm::SDNode::ops
ArrayRef< SDUse > ops() const
Definition: SelectionDAGNodes.h:915
Node
Definition: ItaniumDemangle.h:235
llvm::AMDGPU::HSAMD::Kernel::Arg::Key::IsVolatile
constexpr char IsVolatile[]
Key for Kernel::Arg::Metadata::mIsVolatile.
Definition: AMDGPUMetadata.h:194
llvm::NVPTX::PTXLdStInstCode::Untyped
@ Untyped
Definition: NVPTX.h:119
llvm::peekThroughExtractSubvectors
SDValue peekThroughExtractSubvectors(SDValue V)
Return the non-extracted vector source operand of V if it exists.
Definition: SelectionDAG.cpp:9954
llvm::JumpTableSDNode::getIndex
int getIndex() const
Definition: SelectionDAGNodes.h:1835
llvm::SDVTList
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
Definition: SelectionDAGNodes.h:78
llvm::ISD::ATOMIC_SWAP
@ ATOMIC_SWAP
Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt) Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN,...
Definition: ISDOpcodes.h:1143
llvm::MaskedGatherScatterSDNode::getIndexType
ISD::MemIndexType getIndexType() const
How is Index applied to BasePtr when computing addresses.
Definition: SelectionDAGNodes.h:2677
llvm::ISD::SEXTLOAD
@ SEXTLOAD
Definition: ISDOpcodes.h:1350
llvm::VPLoadSDNode::getMask
const SDValue & getMask() const
Definition: SelectionDAGNodes.h:2424
llvm::FPMathOperator::hasAllowContract
bool hasAllowContract() const
Test if this operation can be floating-point contracted (FMA).
Definition: Operator.h:372
llvm::VPGatherScatterSDNode::getIndex
const SDValue & getIndex() const
Definition: SelectionDAGNodes.h:2608
llvm::MachinePointerInfo::getAddrSpace
unsigned getAddrSpace() const
Return the LLVM IR address space number that this pointer points into.
Definition: MachineOperand.cpp:983
llvm::PointerUnion< const Value *, const PseudoSourceValue * >
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::ilist_node
Definition: ilist_node.h:148
llvm::SmallPtrSetImplBase::size
size_type size() const
Definition: SmallPtrSet.h:92
FoldingSet.h
llvm::LoadSDNode::getBasePtr
const SDValue & getBasePtr() const
Definition: SelectionDAGNodes.h:2319
llvm::AddrSpaceCastSDNode::getDestAddressSpace
unsigned getDestAddressSpace() const
Definition: SelectionDAGNodes.h:1248
llvm::SDNode::getOperationName
std::string getOperationName(const SelectionDAG *G=nullptr) const
Return the opcode of this operation for printing.
Definition: SelectionDAGDumper.cpp:59
llvm::SDUse::operator<
bool operator<(const SDValue &V) const
Convenience function for get().operator<.
Definition: SelectionDAGNodes.h:322
llvm::SDNode::isMemIntrinsic
bool isMemIntrinsic() const
Test if this node is a memory intrinsic (with valid pointer information).
Definition: SelectionDAGNodes.h:658
llvm::AtomicSDNode
This is an SDNode representing atomic operations.
Definition: SelectionDAGNodes.h:1420
llvm::ISD::FrameIndex
@ FrameIndex
Definition: ISDOpcodes.h:80
llvm::MemSDNode::writeMem
bool writeMem() const
Definition: SelectionDAGNodes.h:1270
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::SDNode::dumprFull
void dumprFull(const SelectionDAG *G=nullptr) const
printrFull to dbgs().
Definition: SelectionDAGDumper.cpp:1042
llvm::SDNode::isVPOpcode
bool isVPOpcode() const
Test if this node is a vector predication operation.
Definition: SelectionDAGNodes.h:679
llvm::SDNode::isOnlyUserOf
bool isOnlyUserOf(const SDNode *N) const
Return true if this node is the only use of N.
Definition: SelectionDAG.cpp:10186
ExternalSymbol
MIPS Relocation Principles In there are several elements of the llvm::ISD::NodeType enum that deal with addresses and or relocations These are defined in include llvm Target TargetSelectionDAG td ExternalSymbol
Definition: Relocation.txt:7
llvm::ConstantFPSDNode::isExactlyValue
bool isExactlyValue(double V) const
We don't rely on operator== working on double values, as it returns true for things that are clearly ...
Definition: SelectionDAGNodes.h:1641
llvm::MaskedGatherScatterSDNode::getScale
const SDValue & getScale() const
Definition: SelectionDAGNodes.h:2699
llvm::isAllOnesConstant
bool isAllOnesConstant(SDValue V)
Returns true if V is an integer constant with all bits set.
Definition: SelectionDAG.cpp:9932
llvm::MachineSDNode::clearMemRefs
void clearMemRefs()
Clear out the memory reference descriptor list.
Definition: SelectionDAGNodes.h:2812
llvm::ConstantFPSDNode::getConstantFPValue
const ConstantFP * getConstantFPValue() const
Definition: SelectionDAGNodes.h:1619
llvm::SDValue::operator<
bool operator<(const SDValue &O) const
Definition: SelectionDAGNodes.h:164
llvm::MaskedStoreSDNode::getBasePtr
const SDValue & getBasePtr() const
Definition: SelectionDAGNodes.h:2564
llvm::VPGatherSDNode::VPGatherSDNode
VPGatherSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType)
Definition: SelectionDAGNodes.h:2633
llvm::SDNodeIterator::operator!=
bool operator!=(const SDNodeIterator &x) const
Definition: SelectionDAGNodes.h:2854
std
Definition: BitVector.h:838
llvm::GlobalAddressSDNode
Definition: SelectionDAGNodes.h:1720
llvm::SDNode::LoadSDNodeBitfields
Definition: SelectionDAGNodes.h:529
llvm::VPScatterSDNode::VPScatterSDNode
VPScatterSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType)
Definition: SelectionDAGNodes.h:2649
llvm::SDNode::getNumOperands
unsigned getNumOperands() const
Return the number of values used by this operation.
Definition: SelectionDAGNodes.h:893
llvm::GraphTraits< SDNode * >::getEntryNode
static NodeRef getEntryNode(SDNode *N)
Definition: SelectionDAGNodes.h:2887
llvm::SDNodeFlags::hasNoSignedWrap
bool hasNoSignedWrap() const
Definition: SelectionDAGNodes.h:424
llvm::ISD::isEXTLoad
bool isEXTLoad(const SDNode *N)
Returns true if the specified node is a EXTLOAD.
Definition: SelectionDAGNodes.h:2926
llvm::ConstantSDNode::isMaxSignedValue
bool isMaxSignedValue() const
Definition: SelectionDAGNodes.h:1588
uint16_t
llvm::SDNodeIterator
Definition: SelectionDAGNodes.h:2838
llvm::ConstantPoolSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1900
llvm::MaskedLoadStoreSDNode::getAddressingMode
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc,...
Definition: SelectionDAGNodes.h:2494
llvm::isNullConstant
bool isNullConstant(SDValue V)
Returns true if V is a constant integer zero.
Definition: SelectionDAG.cpp:9922
llvm::EVT::getScalarType
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
Definition: ValueTypes.h:296
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:325
llvm::ISD::STRICT_FP_TO_FP16
@ STRICT_FP_TO_FP16
Definition: ISDOpcodes.h:865
llvm::ISD::TargetExternalSymbol
@ TargetExternalSymbol
Definition: ISDOpcodes.h:169
llvm::MemSDNode::getAddressSpace
unsigned getAddressSpace() const
Return the address space for the associated pointer.
Definition: SelectionDAGNodes.h:1349
llvm::BuildVectorSDNode::getConstantSplatNode
ConstantSDNode * getConstantSplatNode(const APInt &DemandedElts, BitVector *UndefElements=nullptr) const
Returns the demanded splatted constant or null if this is not a constant splat.
Definition: SelectionDAG.cpp:10857
llvm::Align::value
uint64_t value() const
This is a hole in the type system and should not be abused.
Definition: Alignment.h:85
llvm::MCSymbolSDNode::getMCSymbol
MCSymbol * getMCSymbol() const
Definition: SelectionDAGNodes.h:2223
llvm::MDNodeSDNode::getMD
const MDNode * getMD() const
Definition: SelectionDAGNodes.h:2110
llvm::MemSDNode::getAlignment
unsigned getAlignment() const
Definition: SelectionDAGNodes.h:1276
llvm::SDNode::printrWithDepth
void printrWithDepth(raw_ostream &O, const SelectionDAG *G=nullptr, unsigned depth=100) const
Print a SelectionDAG node and children up to depth "depth." The given SelectionDAG allows target-spec...
Definition: SelectionDAGDumper.cpp:1026
JumpTable
MIPS Relocation Principles In there are several elements of the llvm::ISD::NodeType enum that deal with addresses and or relocations These are defined in include llvm Target TargetSelectionDAG td JumpTable
Definition: Relocation.txt:6
llvm::ConstantFPSDNode::isInfinity
bool isInfinity() const
Return true if the value is an infinity.
Definition: SelectionDAGNodes.h:1628
ISDOpcodes.h
llvm::TypeSize
Definition: TypeSize.h:416
llvm::TargetIndexSDNode
Completely target-dependent object reference.
Definition: SelectionDAGNodes.h:1907
llvm::MaskedLoadStoreSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2504
llvm::ISD::BUILD_VECTOR
@ BUILD_VECTOR
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector with the specified,...
Definition: ISDOpcodes.h:491
Casting.h
llvm::MemSDNode::MMO
MachineMemOperand * MMO
Memory reference information.
Definition: SelectionDAGNodes.h:1263
llvm::PointerUnion::getAddrOfPtr1
const First * getAddrOfPtr1() const
If the union is set to the first pointer type get an address pointing to it.
Definition: PointerUnion.h:159
llvm::BitWidth
constexpr unsigned BitWidth
Definition: BitmaskEnum.h:147
llvm::SDNode::use_iterator::operator!=
bool operator!=(const use_iterator &x) const
Definition: SelectionDAGNodes.h:749
llvm::ConstantPoolSDNode::ConstVal
const Constant * ConstVal
Definition: SelectionDAGNodes.h:1848
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::MachineSDNode::memoperands_end
mmo_iterator memoperands_end() const
Definition: SelectionDAGNodes.h:2808
x
TODO unsigned x
Definition: README.txt:10
llvm::SDValue
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
Definition: SelectionDAGNodes.h:137
llvm::SDValue::operator->
SDNode * operator->() const
Definition: SelectionDAGNodes.h:156
llvm::AddrSpaceCastSDNode
Definition: SelectionDAGNodes.h:1238
llvm::LSBaseSDNode::getAddressingMode
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc,...
Definition: SelectionDAGNodes.h:2283
llvm::SDNode::addUse
void addUse(SDUse &U)
This method should only be used by the SDUse class.
Definition: SelectionDAGNodes.h:1054
llvm::ISD::TargetConstant
@ TargetConstant
TargetConstant* - Like Constant*, but the DAG does not do any folding, simplification,...
Definition: ISDOpcodes.h:158
llvm::SDUse::operator!=
bool operator!=(const SDValue &V) const
Convenience function for get().operator!=.
Definition: SelectionDAGNodes.h:317
llvm::MaskedGatherSDNode::getExtensionType
ISD::LoadExtType getExtensionType() const
Definition: SelectionDAGNodes.h:2723
llvm::SDNode::getNumValues
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
Definition: SelectionDAGNodes.h:965
llvm::SrcValueSDNode
An SDNode that holds an arbitrary LLVM IR Value.
Definition: SelectionDAGNodes.h:2082
llvm::MachineSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2817
llvm::MachineMemOperand::isAtomic
bool isAtomic() const
Returns true if this operation has an atomic ordering requirement of unordered or higher,...
Definition: MachineMemOperand.h:297
llvm::TargetIndexSDNode::getIndex
int getIndex() const
Definition: SelectionDAGNodes.h:1920
llvm::PseudoProbeSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1818
llvm::SDNodeFlags
These are IR-level optimization flags that may be propagated to SDNodes.
Definition: SelectionDAGNodes.h:370
llvm::SDNodeFlags::hasExact
bool hasExact() const
Definition: SelectionDAGNodes.h:425
llvm::SDNode::getDebugLoc
const DebugLoc & getDebugLoc() const
Return the source location info.
Definition: SelectionDAGNodes.h:721
llvm::MachineMemOperand::getMergedOrdering
AtomicOrdering getMergedOrdering() const
Return a single atomic ordering that is at least as strong as both the success and failure orderings ...
Definition: MachineMemOperand.h:284
llvm::MachineMemOperand::refineAlignment
void refineAlignment(const MachineMemOperand *MMO)
Update this MachineMemOperand to reflect the alignment of MMO, if it has a greater alignment.
Definition: MachineOperand.cpp:1070
llvm::VPGatherScatterSDNode
This is a base class used to represent VP_GATHER and VP_SCATTER nodes.
Definition: SelectionDAGNodes.h:2576
llvm::ISD::STORE
@ STORE
Definition: ISDOpcodes.h:926
llvm::SDNodeFlags::hasAllowReassociation
bool hasAllowReassociation() const
Definition: SelectionDAGNodes.h:432
llvm::ISD::SSUBO
@ SSUBO
Same for subtraction.
Definition: ISDOpcodes.h:314
llvm::SDValue::isUndef
bool isUndef() const
Definition: SelectionDAGNodes.h:1159
llvm::MemSDNode::isSimple
bool isSimple() const
Returns true if the memory operation is neither atomic or volatile.
Definition: SelectionDAGNodes.h:1335
llvm::AtomicSDNode::getVal
const SDValue & getVal() const
Definition: SelectionDAGNodes.h:1430
llvm::ExternalSymbolSDNode::getSymbol
const char * getSymbol() const
Definition: SelectionDAGNodes.h:2205
llvm::SDNode::getMachineOpcode
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
Definition: SelectionDAGNodes.h:688
llvm::SDNode::PersistentId
uint16_t PersistentId
Unique and persistent id per SDNode in the DAG.
Definition: SelectionDAGNodes.h:618
llvm::makeArrayRef
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Definition: ArrayRef.h:474
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:83
llvm::MaskedLoadSDNode::getMask
const SDValue & getMask() const
Definition: SelectionDAGNodes.h:2529
llvm::VPLoadSDNode::getExtensionType
ISD::LoadExtType getExtensionType() const
Definition: SelectionDAGNodes.h:2418
llvm::VPLoadStoreSDNode::getVectorLength
const SDValue & getVectorLength() const
Definition: SelectionDAGNodes.h:2384
llvm::SDUse::operator==
bool operator==(const SDValue &V) const
Convenience function for get().operator==.
Definition: SelectionDAGNodes.h:312
llvm::SDNode::hasNUsesOfValue
bool hasNUsesOfValue(unsigned NUses, unsigned Value) const
Return true if there are exactly NUSES uses of the indicated value.
Definition: SelectionDAG.cpp:10157
llvm::MemSDNode::getAlign
Align getAlign() const
Definition: SelectionDAGNodes.h:1274
llvm::GlobalAddressSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1738
llvm::ConstantFPSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:1648
llvm::SDNode::op_begin
op_iterator op_begin() const
Definition: SelectionDAGNodes.h:913
llvm::SDValue::isOperandOf
bool isOperandOf(const SDNode *N) const
Return true if this node is an operand of N.
Definition: SelectionDAG.cpp:10212
llvm::LSBaseSDNode
Base class for LoadSDNode and StoreSDNode.
Definition: SelectionDAGNodes.h:2267
llvm::AtomicSDNode::getBasePtr
const SDValue & getBasePtr() const
Definition: SelectionDAGNodes.h:1429
llvm::VPStoreSDNode::classof
static bool classof(const SDNode *N)
Definition: SelectionDAGNodes.h:2463
llvm::MemSDNode::getSrcValueOffset
int64_t getSrcValueOffset() const
Definition: SelectionDAGNodes.h:1303
Instructions.h
llvm::ISD::RegisterMask
@ RegisterMask
Definition: ISDOpcodes.h:75
llvm::ISD::PREFETCH
@ PREFETCH
PREFETCH - This corresponds to a prefetch intrinsic.
Definition: ISDOpcodes.h:1105
llvm::ConstantSDNode::isOpaque
bool isOpaque() const
Definition: SelectionDAGNodes.h:1591
llvm::ConstantPoolSDNode::getMachineCPVal
MachineConstantPoolValue * getMachineCPVal() const
Definition: SelectionDAGNodes.h:1884
SmallVector.h
llvm::ConstantSDNode::isAllOnesValue
bool isAllOnesValue() const
Definition: SelectionDAGNodes.h:1587
llvm::SDValue::getConstantOperandAPInt
const APInt & getConstantOperandAPInt(unsigned i) const
Definition: SelectionDAGNodes.h:1139
llvm::ISD::FIRST_TARGET_MEMORY_OPCODE
static const int FIRST_TARGET_MEMORY_OPCODE
FIRST_TARGET_MEMORY_OPCODE - Target-specific pre-isel operations which do not reference a specific me...
Definition: ISDOpcodes.h:1265
List
const NodeList & List
Definition: RDFGraph.cpp:201
llvm::SDNode::hasPredecessorHelper
static bool hasPredecessorHelper(const SDNode *N, SmallPtrSetImpl< const SDNode * > &Visited, SmallVectorImpl< const SDNode * > &Worklist, unsigned int MaxSteps=0, bool TopologicalPrune=false)
Returns true if N is a predecessor of any node in Worklist.
Definition: SelectionDAGNodes.h:834
llvm::SDNodeFlags::setNoUnsignedWrap
void setNoUnsignedWrap(bool b)
Definition: SelectionDAGNodes.h:410
N
#define N
llvm::VPStoreSDNode::VPStoreSDNode
VPStoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, bool isTrunc, bool isCompressing, EVT MemVT, MachineMemOperand *MMO)
Definition: SelectionDAGNodes.h:2438
llvm::SDNode::getHasDebugValue
bool getHasDebugValue() const
Definition: SelectionDAGNodes.h:693
llvm::SDNode::DropOperands
void DropOperands()
Release the operands and set this node to have zero operands.
Definition: SelectionDAG.cpp:8743
llvm::MemSDNode::getSuccessOrdering
AtomicOrdering getSuccessOrdering() const
Return the atomic ordering requirements for this memory operation.
Definition: SelectionDAGNodes.h:1317
llvm::max
Align max(MaybeAlign Lhs, Align Rhs)
Definition: Alignment.h:340
llvm::GlobalAddressSDNode::getAddressSpace
unsigned getAddressSpace() const
Definition: SelectionDAG.cpp:10688
llvm::SDValue::dumpr
void dumpr() const
Definition: SelectionDAGNodes.h:1183
llvm::ISD::TargetJumpTable
@ TargetJumpTable
Definition: ISDOpcodes.h:167
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
AddressingMode
Definition: SystemZISelLowering.cpp:871
llvm::ISD::SIGNED_UNSCALED
@ SIGNED_UNSCALED
Definition: ISDOpcodes.h:1333
llvm::SDNodeFlags::setNoNaNs
void setNoNaNs(bool b)
Definition: SelectionDAGNodes.h:413
llvm::ConstantSDNode::getAlignValue
Align getAlignValue() const
Definition: SelectionDAGNodes.h:1579
llvm::SDNode::getConstantOperandAPInt
const APInt & getConstantOperandAPInt(unsigned Num) const
Helper method returns the APInt of a ConstantSDNode operand.
Definition: SelectionDAGNodes.h:1603
ilist_node.h
llvm::ISD::isZEXTLoad
bool isZEXTLoad(const SDNode *N)
Returns true if the specified node is a ZEXTLOAD.
Definition: SelectionDAGNodes.h:2938
MachineMemOperand.h
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
llvm::ConstantSDNode::isNullValue
bool isNullValue() const
Definition: SelectionDAGNodes.h:1584
llvm::MachineMemOperand::getFailureOrdering
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur.
Definition: MachineMemOperand.h:277
llvm::MaskedScatterSDNode
This class is used to represent an MSCATTER node.
Definition: SelectionDAGNodes.h:2734
llvm::SDValue::getOpcode
unsigned getOpcode() const
Definition: SelectionDAGNodes.h:1119
llvm::ShuffleVectorSDNode::isSplatMask
static bool isSplatMask(const int *Mask, EVT VT)
Definition: SelectionDAG.cpp:10998
llvm::GraphTraits< SDNode * >::child_begin
static ChildIteratorType child_begin(NodeRef N)
Definition: SelectionDAGNodes.h:2889
llvm::SmallPtrSetImpl
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
Definition: SmallPtrSet.h:343
llvm::ConstantPoolSDNode::MachineCPVal
MachineConstantPoolValue * MachineCPVal
Definition: SelectionDAGNodes.h:1849
llvm::SDUse::operator=
SDUse & operator=(const SDUse &)=delete
llvm::SDNode::isTargetMemoryOpcode
bool isTargetMemoryOpcode() const
Test if this node has a target-specific memory-referencing opcode (in the <target>ISD namespace and g...
Definition: SelectionDAGNodes.h:646
llvm::SDNode::value_end
value_iterator value_end() const
Definition: SelectionDAGNodes.h:990
llvm::ISD::INTRINSIC_W_CHAIN
@ INTRINSIC_W_CHAIN
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
Definition: ISDOpcodes.h:192
llvm::MemSDNode::readMem
bool readMem() const
Definition: SelectionDAGNodes.h:1269
llvm::PseudoProbeSDNode
This SDNode is used for PSEUDO_PROBE values, which are the function guid and the index of the basic b...
Definition: SelectionDAGNodes.h:1801
llvm::ConstantFPSDNode::isZero
bool isZero() const
Return true if the value is positive or negative zero.
Definition: SelectionDAGNodes.h:1622
llvm::SDValue::getDebugLoc
const DebugLoc & getDebugLoc() const
Definition: SelectionDAGNodes.h:1171
Register.h
llvm::SDNodeFlags::hasNoFPExcept
bool hasNoFPExcept() const
Definition: SelectionDAGNodes.h:433
llvm::VPStoreSDNode
This class is used to represent a VP_STORE node.
Definition: SelectionDAGNodes.h:2434
llvm::GraphTraits
Definition: GraphTraits.h:35
llvm::SDNode::setHasDebugValue
void setHasDebugValue(bool b)
Definition: SelectionDAGNodes.h:694
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::VPGatherScatterSDNode::getVectorLength
const SDValue & getVectorLength() const
Definition: SelectionDAGNodes.h:2617
llvm::ISD::isNormalStore
bool isNormalStore(const SDNode *N)
Returns true if the specified node is a non-truncating and unindexed store.
Definition: SelectionDAGNodes.h:2951
llvm::BuildVectorSDNode::getRepeatedSequence
bool getRepeatedSequence(const APInt &DemandedElts, SmallVectorImpl< SDValue > &Sequence, BitVector *UndefElements=nullptr) const
Find the shortest repeating sequence of values in the build vector.
Definition: SelectionDAG.cpp:10804
llvm::ISD::ATOMIC_LOAD_XOR
@ ATOMIC_LOAD_XOR
Definition: ISDOpcodes.h:1149
llvm::SDUse::getNode
SDNode * getNode() const
Convenience function for get().getNode().
Definition: SelectionDAGNodes.h:305
llvm::SDValue::setNode
void setNode(SDNode *N)
set the SDNode
Definition: SelectionDAGNodes.h:154
llvm::ISD::TargetFrameIndex
@ TargetFrameIndex
Definition: ISDOpcodes.h:166
llvm::SDNodeIterator::getNode
const SDNode * getNode() const
Definition: SelectionDAGNodes.h:2880
llvm::VPLoadStoreSDNode::getAddressingMode
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc,...
Definition: SelectionDAGNodes.h:2390
llvm::simplify_type< SDUse >::getSimplifiedValue
static SimpleType getSimplifiedValue(SDUse &Val)
Definition: SelectionDAGNodes.h:362
llvm::MaskedLoadSDNode::getOffset
const SDValue & getOffset() const
Definition: SelectionDAGNodes.h:2528
llvm::AMDGPU::VGPRIndexMode::Id
Id
Definition: SIDefines.h:232
llvm::MachineMemOperand::getRanges
const MDNode * getRanges() const
Return the range tag for the memory reference.
Definition: MachineMemOperand.h:261
llvm::MaskedGatherScatterSDNode::getIndex
const SDValue & getIndex() const
Definition: SelectionDAGNodes.h:2697
llvm::ConstantPoolSDNode::getTargetFlags
unsigned getTargetFlags() const
Definition: SelectionDAGNodes.h:1896
llvm::SDNodeFlags::hasNoSignedZeros
bool hasNoSignedZeros() const
Definition: SelectionDAGNodes.h:428
llvm::SDNode::getSDVTList
static SDVTList getSDVTList(EVT VT)
Definition: SelectionDAGNodes.h:1057
llvm::SDValue::isMachineOpcode
bool isMachineOpcode() const
Definition: SelectionDAGNodes.h:1151
llvm::ISD::allOperandsUndef
bool allOperandsUndef(const SDNode *N)
Return true if the node has at least one operand and all operands of the specified node are ISD::UNDE...
Definition: SelectionDAG.cpp:297