LLVM  14.0.0git
SelectionDAG.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/SelectionDAG.h - InstSelection DAG ----------*- 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 SelectionDAG class, and transitively defines the
10 // SDNode class and subclasses.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_SELECTIONDAG_H
15 #define LLVM_CODEGEN_SELECTIONDAG_H
16 
17 #include "llvm/ADT/APFloat.h"
18 #include "llvm/ADT/APInt.h"
19 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/ADT/DenseMap.h"
21 #include "llvm/ADT/DenseSet.h"
22 #include "llvm/ADT/FoldingSet.h"
23 #include "llvm/ADT/SetVector.h"
24 #include "llvm/ADT/SmallVector.h"
25 #include "llvm/ADT/StringMap.h"
26 #include "llvm/ADT/ilist.h"
27 #include "llvm/ADT/iterator.h"
35 #include "llvm/IR/DebugLoc.h"
36 #include "llvm/IR/Instructions.h"
37 #include "llvm/IR/Metadata.h"
38 #include "llvm/Support/Allocator.h"
41 #include "llvm/Support/Casting.h"
42 #include "llvm/Support/CodeGen.h"
46 #include <algorithm>
47 #include <cassert>
48 #include <cstdint>
49 #include <functional>
50 #include <map>
51 #include <string>
52 #include <tuple>
53 #include <utility>
54 #include <vector>
55 
56 namespace llvm {
57 
58 class AAResults;
59 class BlockAddress;
60 class BlockFrequencyInfo;
61 class Constant;
62 class ConstantFP;
63 class ConstantInt;
64 class DataLayout;
65 struct fltSemantics;
66 class FunctionLoweringInfo;
67 class GlobalValue;
68 struct KnownBits;
69 class LegacyDivergenceAnalysis;
70 class LLVMContext;
71 class MachineBasicBlock;
72 class MachineConstantPoolValue;
73 class MCSymbol;
74 class OptimizationRemarkEmitter;
75 class ProfileSummaryInfo;
76 class SDDbgValue;
77 class SDDbgOperand;
78 class SDDbgLabel;
79 class SelectionDAG;
80 class SelectionDAGTargetInfo;
81 class TargetLibraryInfo;
82 class TargetLowering;
83 class TargetMachine;
84 class TargetSubtargetInfo;
85 class Value;
86 
87 class SDVTListNode : public FoldingSetNode {
88  friend struct FoldingSetTrait<SDVTListNode>;
89 
90  /// A reference to an Interned FoldingSetNodeID for this node.
91  /// The Allocator in SelectionDAG holds the data.
92  /// SDVTList contains all types which are frequently accessed in SelectionDAG.
93  /// The size of this list is not expected to be big so it won't introduce
94  /// a memory penalty.
95  FoldingSetNodeIDRef FastID;
96  const EVT *VTs;
97  unsigned int NumVTs;
98  /// The hash value for SDVTList is fixed, so cache it to avoid
99  /// hash calculation.
100  unsigned HashValue;
101 
102 public:
103  SDVTListNode(const FoldingSetNodeIDRef ID, const EVT *VT, unsigned int Num) :
104  FastID(ID), VTs(VT), NumVTs(Num) {
105  HashValue = ID.ComputeHash();
106  }
107 
109  SDVTList result = {VTs, NumVTs};
110  return result;
111  }
112 };
113 
114 /// Specialize FoldingSetTrait for SDVTListNode
115 /// to avoid computing temp FoldingSetNodeID and hash value.
116 template<> struct FoldingSetTrait<SDVTListNode> : DefaultFoldingSetTrait<SDVTListNode> {
117  static void Profile(const SDVTListNode &X, FoldingSetNodeID& ID) {
118  ID = X.FastID;
119  }
120 
121  static bool Equals(const SDVTListNode &X, const FoldingSetNodeID &ID,
122  unsigned IDHash, FoldingSetNodeID &TempID) {
123  if (X.HashValue != IDHash)
124  return false;
125  return ID == X.FastID;
126  }
127 
128  static unsigned ComputeHash(const SDVTListNode &X, FoldingSetNodeID &TempID) {
129  return X.HashValue;
130  }
131 };
132 
133 template <> struct ilist_alloc_traits<SDNode> {
134  static void deleteNode(SDNode *) {
135  llvm_unreachable("ilist_traits<SDNode> shouldn't see a deleteNode call!");
136  }
137 };
138 
139 /// Keeps track of dbg_value information through SDISel. We do
140 /// not build SDNodes for these so as not to perturb the generated code;
141 /// instead the info is kept off to the side in this structure. Each SDNode may
142 /// have one or more associated dbg_value entries. This information is kept in
143 /// DbgValMap.
144 /// Byval parameters are handled separately because they don't use alloca's,
145 /// which busts the normal mechanism. There is good reason for handling all
146 /// parameters separately: they may not have code generated for them, they
147 /// should always go at the beginning of the function regardless of other code
148 /// motion, and debug info for them is potentially useful even if the parameter
149 /// is unused. Right now only byval parameters are handled separately.
150 class SDDbgInfo {
151  BumpPtrAllocator Alloc;
153  SmallVector<SDDbgValue*, 32> ByvalParmDbgValues;
154  SmallVector<SDDbgLabel*, 4> DbgLabels;
156  DbgValMapType DbgValMap;
157 
158 public:
159  SDDbgInfo() = default;
160  SDDbgInfo(const SDDbgInfo &) = delete;
161  SDDbgInfo &operator=(const SDDbgInfo &) = delete;
162 
163  void add(SDDbgValue *V, bool isParameter);
164 
165  void add(SDDbgLabel *L) { DbgLabels.push_back(L); }
166 
167  /// Invalidate all DbgValues attached to the node and remove
168  /// it from the Node-to-DbgValues map.
169  void erase(const SDNode *Node);
170 
171  void clear() {
172  DbgValMap.clear();
173  DbgValues.clear();
174  ByvalParmDbgValues.clear();
175  DbgLabels.clear();
176  Alloc.Reset();
177  }
178 
179  BumpPtrAllocator &getAlloc() { return Alloc; }
180 
181  bool empty() const {
182  return DbgValues.empty() && ByvalParmDbgValues.empty() && DbgLabels.empty();
183  }
184 
186  auto I = DbgValMap.find(Node);
187  if (I != DbgValMap.end())
188  return I->second;
189  return ArrayRef<SDDbgValue*>();
190  }
191 
194 
195  DbgIterator DbgBegin() { return DbgValues.begin(); }
196  DbgIterator DbgEnd() { return DbgValues.end(); }
197  DbgIterator ByvalParmDbgBegin() { return ByvalParmDbgValues.begin(); }
198  DbgIterator ByvalParmDbgEnd() { return ByvalParmDbgValues.end(); }
199  DbgLabelIterator DbgLabelBegin() { return DbgLabels.begin(); }
200  DbgLabelIterator DbgLabelEnd() { return DbgLabels.end(); }
201 };
202 
203 void checkForCycles(const SelectionDAG *DAG, bool force = false);
204 
205 /// This is used to represent a portion of an LLVM function in a low-level
206 /// Data Dependence DAG representation suitable for instruction selection.
207 /// This DAG is constructed as the first step of instruction selection in order
208 /// to allow implementation of machine specific optimizations
209 /// and code simplifications.
210 ///
211 /// The representation used by the SelectionDAG is a target-independent
212 /// representation, which has some similarities to the GCC RTL representation,
213 /// but is significantly more simple, powerful, and is a graph form instead of a
214 /// linear form.
215 ///
217  const TargetMachine &TM;
218  const SelectionDAGTargetInfo *TSI = nullptr;
219  const TargetLowering *TLI = nullptr;
220  const TargetLibraryInfo *LibInfo = nullptr;
221  MachineFunction *MF;
222  Pass *SDAGISelPass = nullptr;
223  LLVMContext *Context;
224  CodeGenOpt::Level OptLevel;
225 
226  LegacyDivergenceAnalysis * DA = nullptr;
227  FunctionLoweringInfo * FLI = nullptr;
228 
229  /// The function-level optimization remark emitter. Used to emit remarks
230  /// whenever manipulating the DAG.
232 
233  ProfileSummaryInfo *PSI = nullptr;
234  BlockFrequencyInfo *BFI = nullptr;
235 
236  /// The starting token.
237  SDNode EntryNode;
238 
239  /// The root of the entire DAG.
240  SDValue Root;
241 
242  /// A linked list of nodes in the current DAG.
243  ilist<SDNode> AllNodes;
244 
245  /// The AllocatorType for allocating SDNodes. We use
246  /// pool allocation with recycling.
248  sizeof(LargestSDNode),
249  alignof(MostAlignedSDNode)>;
250 
251  /// Pool allocation for nodes.
252  NodeAllocatorType NodeAllocator;
253 
254  /// This structure is used to memoize nodes, automatically performing
255  /// CSE with existing nodes when a duplicate is requested.
256  FoldingSet<SDNode> CSEMap;
257 
258  /// Pool allocation for machine-opcode SDNode operands.
259  BumpPtrAllocator OperandAllocator;
260  ArrayRecycler<SDUse> OperandRecycler;
261 
262  /// Pool allocation for misc. objects that are created once per SelectionDAG.
263  BumpPtrAllocator Allocator;
264 
265  /// Tracks dbg_value and dbg_label information through SDISel.
266  SDDbgInfo *DbgInfo;
267 
270 
271  struct CallSiteDbgInfo {
272  CallSiteInfo CSInfo;
273  MDNode *HeapAllocSite = nullptr;
274  bool NoMerge = false;
275  };
276 
278 
279  uint16_t NextPersistentId = 0;
280 
281 public:
282  /// Clients of various APIs that cause global effects on
283  /// the DAG can optionally implement this interface. This allows the clients
284  /// to handle the various sorts of updates that happen.
285  ///
286  /// A DAGUpdateListener automatically registers itself with DAG when it is
287  /// constructed, and removes itself when destroyed in RAII fashion.
291 
293  : Next(D.UpdateListeners), DAG(D) {
294  DAG.UpdateListeners = this;
295  }
296 
297  virtual ~DAGUpdateListener() {
298  assert(DAG.UpdateListeners == this &&
299  "DAGUpdateListeners must be destroyed in LIFO order");
300  DAG.UpdateListeners = Next;
301  }
302 
303  /// The node N that was deleted and, if E is not null, an
304  /// equivalent node E that replaced it.
305  virtual void NodeDeleted(SDNode *N, SDNode *E);
306 
307  /// The node N that was updated.
308  virtual void NodeUpdated(SDNode *N);
309 
310  /// The node N that was inserted.
311  virtual void NodeInserted(SDNode *N);
312  };
313 
316 
318  std::function<void(SDNode *, SDNode *)> Callback)
320 
321  void NodeDeleted(SDNode *N, SDNode *E) override { Callback(N, E); }
322 
323  private:
324  virtual void anchor();
325  };
326 
327  /// Help to insert SDNodeFlags automatically in transforming. Use
328  /// RAII to save and resume flags in current scope.
329  class FlagInserter {
330  SelectionDAG &DAG;
331  SDNodeFlags Flags;
332  FlagInserter *LastInserter;
333 
334  public:
336  : DAG(SDAG), Flags(Flags),
337  LastInserter(SDAG.getFlagInserter()) {
338  SDAG.setFlagInserter(this);
339  }
341  : FlagInserter(SDAG, N->getFlags()) {}
342 
343  FlagInserter(const FlagInserter &) = delete;
344  FlagInserter &operator=(const FlagInserter &) = delete;
345  ~FlagInserter() { DAG.setFlagInserter(LastInserter); }
346 
347  SDNodeFlags getFlags() const { return Flags; }
348  };
349 
350  /// When true, additional steps are taken to
351  /// ensure that getConstant() and similar functions return DAG nodes that
352  /// have legal types. This is important after type legalization since
353  /// any illegally typed nodes generated after this point will not experience
354  /// type legalization.
356 
357 private:
358  /// DAGUpdateListener is a friend so it can manipulate the listener stack.
359  friend struct DAGUpdateListener;
360 
361  /// Linked list of registered DAGUpdateListener instances.
362  /// This stack is maintained by DAGUpdateListener RAII.
363  DAGUpdateListener *UpdateListeners = nullptr;
364 
365  /// Implementation of setSubgraphColor.
366  /// Return whether we had to truncate the search.
367  bool setSubgraphColorHelper(SDNode *N, const char *Color,
368  DenseSet<SDNode *> &visited,
369  int level, bool &printed);
370 
371  template <typename SDNodeT, typename... ArgTypes>
372  SDNodeT *newSDNode(ArgTypes &&... Args) {
373  return new (NodeAllocator.template Allocate<SDNodeT>())
374  SDNodeT(std::forward<ArgTypes>(Args)...);
375  }
376 
377  /// Build a synthetic SDNodeT with the given args and extract its subclass
378  /// data as an integer (e.g. for use in a folding set).
379  ///
380  /// The args to this function are the same as the args to SDNodeT's
381  /// constructor, except the second arg (assumed to be a const DebugLoc&) is
382  /// omitted.
383  template <typename SDNodeT, typename... ArgTypes>
384  static uint16_t getSyntheticNodeSubclassData(unsigned IROrder,
385  ArgTypes &&... Args) {
386  // The compiler can reduce this expression to a constant iff we pass an
387  // empty DebugLoc. Thankfully, the debug location doesn't have any bearing
388  // on the subclass data.
389  return SDNodeT(IROrder, DebugLoc(), std::forward<ArgTypes>(Args)...)
390  .getRawSubclassData();
391  }
392 
393  template <typename SDNodeTy>
394  static uint16_t getSyntheticNodeSubclassData(unsigned Opc, unsigned Order,
395  SDVTList VTs, EVT MemoryVT,
396  MachineMemOperand *MMO) {
397  return SDNodeTy(Opc, Order, DebugLoc(), VTs, MemoryVT, MMO)
398  .getRawSubclassData();
399  }
400 
401  void createOperands(SDNode *Node, ArrayRef<SDValue> Vals);
402 
403  void removeOperands(SDNode *Node) {
404  if (!Node->OperandList)
405  return;
406  OperandRecycler.deallocate(
408  Node->OperandList);
409  Node->NumOperands = 0;
410  Node->OperandList = nullptr;
411  }
412  void CreateTopologicalOrder(std::vector<SDNode*>& Order);
413 
414 public:
415  // Maximum depth for recursive analysis such as computeKnownBits, etc.
416  static constexpr unsigned MaxRecursionDepth = 6;
417 
419  SelectionDAG(const SelectionDAG &) = delete;
420  SelectionDAG &operator=(const SelectionDAG &) = delete;
421  ~SelectionDAG();
422 
423  /// Prepare this SelectionDAG to process code in the given MachineFunction.
424  void init(MachineFunction &NewMF, OptimizationRemarkEmitter &NewORE,
425  Pass *PassPtr, const TargetLibraryInfo *LibraryInfo,
426  LegacyDivergenceAnalysis * Divergence,
427  ProfileSummaryInfo *PSIin, BlockFrequencyInfo *BFIin);
428 
430  FLI = FuncInfo;
431  }
432 
433  /// Clear state and free memory necessary to make this
434  /// SelectionDAG ready to process a new block.
435  void clear();
436 
437  MachineFunction &getMachineFunction() const { return *MF; }
438  const Pass *getPass() const { return SDAGISelPass; }
439 
440  const DataLayout &getDataLayout() const { return MF->getDataLayout(); }
441  const TargetMachine &getTarget() const { return TM; }
442  const TargetSubtargetInfo &getSubtarget() const { return MF->getSubtarget(); }
443  const TargetLowering &getTargetLoweringInfo() const { return *TLI; }
444  const TargetLibraryInfo &getLibInfo() const { return *LibInfo; }
445  const SelectionDAGTargetInfo &getSelectionDAGInfo() const { return *TSI; }
447  LLVMContext *getContext() const { return Context; }
448  OptimizationRemarkEmitter &getORE() const { return *ORE; }
449  ProfileSummaryInfo *getPSI() const { return PSI; }
450  BlockFrequencyInfo *getBFI() const { return BFI; }
451 
452  FlagInserter *getFlagInserter() { return Inserter; }
453  void setFlagInserter(FlagInserter *FI) { Inserter = FI; }
454 
455  /// Just dump dot graph to a user-provided path and title.
456  /// This doesn't open the dot viewer program and
457  /// helps visualization when outside debugging session.
458  /// FileName expects absolute path. If provided
459  /// without any path separators then the file
460  /// will be created in the current directory.
461  /// Error will be emitted if the path is insane.
462 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
463  LLVM_DUMP_METHOD void dumpDotGraph(const Twine &FileName, const Twine &Title);
464 #endif
465 
466  /// Pop up a GraphViz/gv window with the DAG rendered using 'dot'.
467  void viewGraph(const std::string &Title);
468  void viewGraph();
469 
470 #ifndef NDEBUG
471  std::map<const SDNode *, std::string> NodeGraphAttrs;
472 #endif
473 
474  /// Clear all previously defined node graph attributes.
475  /// Intended to be used from a debugging tool (eg. gdb).
476  void clearGraphAttrs();
477 
478  /// Set graph attributes for a node. (eg. "color=red".)
479  void setGraphAttrs(const SDNode *N, const char *Attrs);
480 
481  /// Get graph attributes for a node. (eg. "color=red".)
482  /// Used from getNodeAttributes.
483  std::string getGraphAttrs(const SDNode *N) const;
484 
485  /// Convenience for setting node color attribute.
486  void setGraphColor(const SDNode *N, const char *Color);
487 
488  /// Convenience for setting subgraph color attribute.
489  void setSubgraphColor(SDNode *N, const char *Color);
490 
492 
493  allnodes_const_iterator allnodes_begin() const { return AllNodes.begin(); }
494  allnodes_const_iterator allnodes_end() const { return AllNodes.end(); }
495 
497 
498  allnodes_iterator allnodes_begin() { return AllNodes.begin(); }
499  allnodes_iterator allnodes_end() { return AllNodes.end(); }
500 
502  return AllNodes.size();
503  }
504 
507  }
510  }
511 
512  /// Return the root tag of the SelectionDAG.
513  const SDValue &getRoot() const { return Root; }
514 
515  /// Return the token chain corresponding to the entry of the function.
517  return SDValue(const_cast<SDNode *>(&EntryNode), 0);
518  }
519 
520  /// Set the current root tag of the SelectionDAG.
521  ///
523  assert((!N.getNode() || N.getValueType() == MVT::Other) &&
524  "DAG root value is not a chain!");
525  if (N.getNode())
526  checkForCycles(N.getNode(), this);
527  Root = N;
528  if (N.getNode())
529  checkForCycles(this);
530  return Root;
531  }
532 
533 #ifndef NDEBUG
534  void VerifyDAGDiverence();
535 #endif
536 
537  /// This iterates over the nodes in the SelectionDAG, folding
538  /// certain types of nodes together, or eliminating superfluous nodes. The
539  /// Level argument controls whether Combine is allowed to produce nodes and
540  /// types that are illegal on the target.
542  CodeGenOpt::Level OptLevel);
543 
544  /// This transforms the SelectionDAG into a SelectionDAG that
545  /// only uses types natively supported by the target.
546  /// Returns "true" if it made any changes.
547  ///
548  /// Note that this is an involved process that may invalidate pointers into
549  /// the graph.
550  bool LegalizeTypes();
551 
552  /// This transforms the SelectionDAG into a SelectionDAG that is
553  /// compatible with the target instruction selector, as indicated by the
554  /// TargetLowering object.
555  ///
556  /// Note that this is an involved process that may invalidate pointers into
557  /// the graph.
558  void Legalize();
559 
560  /// Transforms a SelectionDAG node and any operands to it into a node
561  /// that is compatible with the target instruction selector, as indicated by
562  /// the TargetLowering object.
563  ///
564  /// \returns true if \c N is a valid, legal node after calling this.
565  ///
566  /// This essentially runs a single recursive walk of the \c Legalize process
567  /// over the given node (and its operands). This can be used to incrementally
568  /// legalize the DAG. All of the nodes which are directly replaced,
569  /// potentially including N, are added to the output parameter \c
570  /// UpdatedNodes so that the delta to the DAG can be understood by the
571  /// caller.
572  ///
573  /// When this returns false, N has been legalized in a way that make the
574  /// pointer passed in no longer valid. It may have even been deleted from the
575  /// DAG, and so it shouldn't be used further. When this returns true, the
576  /// N passed in is a legal node, and can be immediately processed as such.
577  /// This may still have done some work on the DAG, and will still populate
578  /// UpdatedNodes with any new nodes replacing those originally in the DAG.
579  bool LegalizeOp(SDNode *N, SmallSetVector<SDNode *, 16> &UpdatedNodes);
580 
581  /// This transforms the SelectionDAG into a SelectionDAG
582  /// that only uses vector math operations supported by the target. This is
583  /// necessary as a separate step from Legalize because unrolling a vector
584  /// operation can introduce illegal types, which requires running
585  /// LegalizeTypes again.
586  ///
587  /// This returns true if it made any changes; in that case, LegalizeTypes
588  /// is called again before Legalize.
589  ///
590  /// Note that this is an involved process that may invalidate pointers into
591  /// the graph.
592  bool LegalizeVectors();
593 
594  /// This method deletes all unreachable nodes in the SelectionDAG.
595  void RemoveDeadNodes();
596 
597  /// Remove the specified node from the system. This node must
598  /// have no referrers.
599  void DeleteNode(SDNode *N);
600 
601  /// Return an SDVTList that represents the list of values specified.
602  SDVTList getVTList(EVT VT);
603  SDVTList getVTList(EVT VT1, EVT VT2);
604  SDVTList getVTList(EVT VT1, EVT VT2, EVT VT3);
605  SDVTList getVTList(EVT VT1, EVT VT2, EVT VT3, EVT VT4);
607 
608  //===--------------------------------------------------------------------===//
609  // Node creation methods.
610 
611  /// Create a ConstantSDNode wrapping a constant value.
612  /// If VT is a vector type, the constant is splatted into a BUILD_VECTOR.
613  ///
614  /// If only legal types can be produced, this does the necessary
615  /// transformations (e.g., if the vector element type is illegal).
616  /// @{
617  SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT,
618  bool isTarget = false, bool isOpaque = false);
619  SDValue getConstant(const APInt &Val, const SDLoc &DL, EVT VT,
620  bool isTarget = false, bool isOpaque = false);
621 
622  SDValue getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget = false,
623  bool IsOpaque = false) {
625  VT, IsTarget, IsOpaque);
626  }
627 
628  SDValue getConstant(const ConstantInt &Val, const SDLoc &DL, EVT VT,
629  bool isTarget = false, bool isOpaque = false);
630  SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL,
631  bool isTarget = false);
632  SDValue getShiftAmountConstant(uint64_t Val, EVT VT, const SDLoc &DL,
633  bool LegalTypes = true);
634  SDValue getVectorIdxConstant(uint64_t Val, const SDLoc &DL,
635  bool isTarget = false);
636 
637  SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT,
638  bool isOpaque = false) {
639  return getConstant(Val, DL, VT, true, isOpaque);
640  }
641  SDValue getTargetConstant(const APInt &Val, const SDLoc &DL, EVT VT,
642  bool isOpaque = false) {
643  return getConstant(Val, DL, VT, true, isOpaque);
644  }
646  bool isOpaque = false) {
647  return getConstant(Val, DL, VT, true, isOpaque);
648  }
649 
650  /// Create a true or false constant of type \p VT using the target's
651  /// BooleanContent for type \p OpVT.
652  SDValue getBoolConstant(bool V, const SDLoc &DL, EVT VT, EVT OpVT);
653  /// @}
654 
655  /// Create a ConstantFPSDNode wrapping a constant value.
656  /// If VT is a vector type, the constant is splatted into a BUILD_VECTOR.
657  ///
658  /// If only legal types can be produced, this does the necessary
659  /// transformations (e.g., if the vector element type is illegal).
660  /// The forms that take a double should only be used for simple constants
661  /// that can be exactly represented in VT. No checks are made.
662  /// @{
663  SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT,
664  bool isTarget = false);
665  SDValue getConstantFP(const APFloat &Val, const SDLoc &DL, EVT VT,
666  bool isTarget = false);
667  SDValue getConstantFP(const ConstantFP &V, const SDLoc &DL, EVT VT,
668  bool isTarget = false);
669  SDValue getTargetConstantFP(double Val, const SDLoc &DL, EVT VT) {
670  return getConstantFP(Val, DL, VT, true);
671  }
672  SDValue getTargetConstantFP(const APFloat &Val, const SDLoc &DL, EVT VT) {
673  return getConstantFP(Val, DL, VT, true);
674  }
675  SDValue getTargetConstantFP(const ConstantFP &Val, const SDLoc &DL, EVT VT) {
676  return getConstantFP(Val, DL, VT, true);
677  }
678  /// @}
679 
680  SDValue getGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT,
681  int64_t offset = 0, bool isTargetGA = false,
682  unsigned TargetFlags = 0);
684  int64_t offset = 0, unsigned TargetFlags = 0) {
685  return getGlobalAddress(GV, DL, VT, offset, true, TargetFlags);
686  }
687  SDValue getFrameIndex(int FI, EVT VT, bool isTarget = false);
689  return getFrameIndex(FI, VT, true);
690  }
691  SDValue getJumpTable(int JTI, EVT VT, bool isTarget = false,
692  unsigned TargetFlags = 0);
693  SDValue getTargetJumpTable(int JTI, EVT VT, unsigned TargetFlags = 0) {
694  return getJumpTable(JTI, VT, true, TargetFlags);
695  }
697  int Offs = 0, bool isT = false,
698  unsigned TargetFlags = 0);
700  MaybeAlign Align = None, int Offset = 0,
701  unsigned TargetFlags = 0) {
702  return getConstantPool(C, VT, Align, Offset, true, TargetFlags);
703  }
705  MaybeAlign Align = None, int Offs = 0,
706  bool isT = false, unsigned TargetFlags = 0);
708  MaybeAlign Align = None, int Offset = 0,
709  unsigned TargetFlags = 0) {
710  return getConstantPool(C, VT, Align, Offset, true, TargetFlags);
711  }
712  SDValue getTargetIndex(int Index, EVT VT, int64_t Offset = 0,
713  unsigned TargetFlags = 0);
714  // When generating a branch to a BB, we don't in general know enough
715  // to provide debug info for the BB at that time, so keep this one around.
717  SDValue getExternalSymbol(const char *Sym, EVT VT);
718  SDValue getTargetExternalSymbol(const char *Sym, EVT VT,
719  unsigned TargetFlags = 0);
720  SDValue getMCSymbol(MCSymbol *Sym, EVT VT);
721 
723  SDValue getRegister(unsigned Reg, EVT VT);
724  SDValue getRegisterMask(const uint32_t *RegMask);
725  SDValue getEHLabel(const SDLoc &dl, SDValue Root, MCSymbol *Label);
726  SDValue getLabelNode(unsigned Opcode, const SDLoc &dl, SDValue Root,
727  MCSymbol *Label);
728  SDValue getBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset = 0,
729  bool isTarget = false, unsigned TargetFlags = 0);
731  int64_t Offset = 0, unsigned TargetFlags = 0) {
732  return getBlockAddress(BA, VT, Offset, true, TargetFlags);
733  }
734 
735  SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg,
736  SDValue N) {
737  return getNode(ISD::CopyToReg, dl, MVT::Other, Chain,
738  getRegister(Reg, N.getValueType()), N);
739  }
740 
741  // This version of the getCopyToReg method takes an extra operand, which
742  // indicates that there is potentially an incoming glue value (if Glue is not
743  // null) and that there should be a glue result.
744  SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N,
745  SDValue Glue) {
747  SDValue Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Glue };
748  return getNode(ISD::CopyToReg, dl, VTs,
749  makeArrayRef(Ops, Glue.getNode() ? 4 : 3));
750  }
751 
752  // Similar to last getCopyToReg() except parameter Reg is a SDValue
754  SDValue Glue) {
756  SDValue Ops[] = { Chain, Reg, N, Glue };
757  return getNode(ISD::CopyToReg, dl, VTs,
758  makeArrayRef(Ops, Glue.getNode() ? 4 : 3));
759  }
760 
761  SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT) {
762  SDVTList VTs = getVTList(VT, MVT::Other);
763  SDValue Ops[] = { Chain, getRegister(Reg, VT) };
764  return getNode(ISD::CopyFromReg, dl, VTs, Ops);
765  }
766 
767  // This version of the getCopyFromReg method takes an extra operand, which
768  // indicates that there is potentially an incoming glue value (if Glue is not
769  // null) and that there should be a glue result.
770  SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT,
771  SDValue Glue) {
773  SDValue Ops[] = { Chain, getRegister(Reg, VT), Glue };
774  return getNode(ISD::CopyFromReg, dl, VTs,
775  makeArrayRef(Ops, Glue.getNode() ? 3 : 2));
776  }
777 
779 
780  /// Return an ISD::VECTOR_SHUFFLE node. The number of elements in VT,
781  /// which must be a vector type, must match the number of mask elements
782  /// NumElts. An integer mask element equal to -1 is treated as undefined.
783  SDValue getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1, SDValue N2,
785 
786  /// Return an ISD::BUILD_VECTOR node. The number of elements in VT,
787  /// which must be a vector type, must match the number of operands in Ops.
788  /// The operands must have the same type as (or, for integers, a type wider
789  /// than) VT's element type.
791  // VerifySDNode (via InsertNode) checks BUILD_VECTOR later.
792  return getNode(ISD::BUILD_VECTOR, DL, VT, Ops);
793  }
794 
795  /// Return an ISD::BUILD_VECTOR node. The number of elements in VT,
796  /// which must be a vector type, must match the number of operands in Ops.
797  /// The operands must have the same type as (or, for integers, a type wider
798  /// than) VT's element type.
800  // VerifySDNode (via InsertNode) checks BUILD_VECTOR later.
801  return getNode(ISD::BUILD_VECTOR, DL, VT, Ops);
802  }
803 
804  /// Return a splat ISD::BUILD_VECTOR node, consisting of Op splatted to all
805  /// elements. VT must be a vector type. Op's type must be the same as (or,
806  /// for integers, a type wider than) VT's element type.
808  // VerifySDNode (via InsertNode) checks BUILD_VECTOR later.
809  if (Op.getOpcode() == ISD::UNDEF) {
810  assert((VT.getVectorElementType() == Op.getValueType() ||
811  (VT.isInteger() &&
812  VT.getVectorElementType().bitsLE(Op.getValueType()))) &&
813  "A splatted value must have a width equal or (for integers) "
814  "greater than the vector element type!");
815  return getNode(ISD::UNDEF, SDLoc(), VT);
816  }
817 
819  return getNode(ISD::BUILD_VECTOR, DL, VT, Ops);
820  }
821 
822  // Return a splat ISD::SPLAT_VECTOR node, consisting of Op splatted to all
823  // elements.
825  if (Op.getOpcode() == ISD::UNDEF) {
826  assert((VT.getVectorElementType() == Op.getValueType() ||
827  (VT.isInteger() &&
828  VT.getVectorElementType().bitsLE(Op.getValueType()))) &&
829  "A splatted value must have a width equal or (for integers) "
830  "greater than the vector element type!");
831  return getNode(ISD::UNDEF, SDLoc(), VT);
832  }
833  return getNode(ISD::SPLAT_VECTOR, DL, VT, Op);
834  }
835 
836  /// Returns a vector of type ResVT whose elements contain the linear sequence
837  /// <0, Step, Step * 2, Step * 3, ...>
838  SDValue getStepVector(const SDLoc &DL, EVT ResVT, APInt StepVal);
839 
840  /// Returns a vector of type ResVT whose elements contain the linear sequence
841  /// <0, 1, 2, 3, ...>
842  SDValue getStepVector(const SDLoc &DL, EVT ResVT);
843 
844  /// Returns an ISD::VECTOR_SHUFFLE node semantically equivalent to
845  /// the shuffle node in input but with swapped operands.
846  ///
847  /// Example: shuffle A, B, <0,5,2,7> -> shuffle B, A, <4,1,6,3>
849 
850  /// Convert Op, which must be of float type, to the
851  /// float type VT, by either extending or rounding (by truncation).
853 
854  /// Convert Op, which must be a STRICT operation of float type, to the
855  /// float type VT, by either extending or rounding (by truncation).
856  std::pair<SDValue, SDValue>
857  getStrictFPExtendOrRound(SDValue Op, SDValue Chain, const SDLoc &DL, EVT VT);
858 
859  /// Convert Op, which must be of integer type, to the
860  /// integer type VT, by either any-extending or truncating it.
862 
863  /// Convert Op, which must be of integer type, to the
864  /// integer type VT, by either sign-extending or truncating it.
865  SDValue getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT);
866 
867  /// Convert Op, which must be of integer type, to the
868  /// integer type VT, by either zero-extending or truncating it.
869  SDValue getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT);
870 
871  /// Return the expression required to zero extend the Op
872  /// value assuming it was the smaller SrcTy value.
874 
875  /// Convert Op, which must be of integer type, to the integer type VT, by
876  /// either truncating it or performing either zero or sign extension as
877  /// appropriate extension for the pointer's semantics.
879 
880  /// Return the expression required to extend the Op as a pointer value
881  /// assuming it was the smaller SrcTy value. This may be either a zero extend
882  /// or a sign extend.
884 
885  /// Convert Op, which must be of integer type, to the integer type VT,
886  /// by using an extension appropriate for the target's
887  /// BooleanContent for type OpVT or truncating it.
888  SDValue getBoolExtOrTrunc(SDValue Op, const SDLoc &SL, EVT VT, EVT OpVT);
889 
890  /// Create a bitwise NOT operation as (XOR Val, -1).
891  SDValue getNOT(const SDLoc &DL, SDValue Val, EVT VT);
892 
893  /// Create a logical NOT operation as (XOR Val, BooleanOne).
894  SDValue getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT);
895 
896  /// Returns sum of the base pointer and offset.
897  /// Unlike getObjectPtrOffset this does not set NoUnsignedWrap by default.
899  const SDNodeFlags Flags = SDNodeFlags());
901  const SDNodeFlags Flags = SDNodeFlags());
902 
903  /// Create an add instruction with appropriate flags when used for
904  /// addressing some offset of an object. i.e. if a load is split into multiple
905  /// components, create an add nuw from the base pointer to the offset.
907  SDNodeFlags Flags;
908  Flags.setNoUnsignedWrap(true);
909  return getMemBasePlusOffset(Ptr, Offset, SL, Flags);
910  }
911 
913  // The object itself can't wrap around the address space, so it shouldn't be
914  // possible for the adds of the offsets to the split parts to overflow.
915  SDNodeFlags Flags;
916  Flags.setNoUnsignedWrap(true);
917  return getMemBasePlusOffset(Ptr, Offset, SL, Flags);
918  }
919 
920  /// Return a new CALLSEQ_START node, that starts new call frame, in which
921  /// InSize bytes are set up inside CALLSEQ_START..CALLSEQ_END sequence and
922  /// OutSize specifies part of the frame set up prior to the sequence.
923  SDValue getCALLSEQ_START(SDValue Chain, uint64_t InSize, uint64_t OutSize,
924  const SDLoc &DL) {
926  SDValue Ops[] = { Chain,
927  getIntPtrConstant(InSize, DL, true),
928  getIntPtrConstant(OutSize, DL, true) };
929  return getNode(ISD::CALLSEQ_START, DL, VTs, Ops);
930  }
931 
932  /// Return a new CALLSEQ_END node, which always must have a
933  /// glue result (to ensure it's not CSE'd).
934  /// CALLSEQ_END does not have a useful SDLoc.
936  SDValue InGlue, const SDLoc &DL) {
939  Ops.push_back(Chain);
940  Ops.push_back(Op1);
941  Ops.push_back(Op2);
942  if (InGlue.getNode())
943  Ops.push_back(InGlue);
944  return getNode(ISD::CALLSEQ_END, DL, NodeTys, Ops);
945  }
946 
947  /// Return true if the result of this operation is always undefined.
948  bool isUndef(unsigned Opcode, ArrayRef<SDValue> Ops);
949 
950  /// Return an UNDEF node. UNDEF does not have a useful SDLoc.
952  return getNode(ISD::UNDEF, SDLoc(), VT);
953  }
954 
955  /// Return a node that represents the runtime scaling 'MulImm * RuntimeVL'.
956  SDValue getVScale(const SDLoc &DL, EVT VT, APInt MulImm) {
957  assert(MulImm.getMinSignedBits() <= VT.getSizeInBits() &&
958  "Immediate does not fit VT");
959  return getNode(ISD::VSCALE, DL, VT,
960  getConstant(MulImm.sextOrTrunc(VT.getSizeInBits()), DL, VT));
961  }
962 
963  /// Return a GLOBAL_OFFSET_TABLE node. This does not have a useful SDLoc.
965  return getNode(ISD::GLOBAL_OFFSET_TABLE, SDLoc(), VT);
966  }
967 
968  /// Gets or creates the specified node.
969  ///
970  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
971  ArrayRef<SDUse> Ops);
972  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
973  ArrayRef<SDValue> Ops, const SDNodeFlags Flags);
974  SDValue getNode(unsigned Opcode, const SDLoc &DL, ArrayRef<EVT> ResultTys,
975  ArrayRef<SDValue> Ops);
976  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
977  ArrayRef<SDValue> Ops, const SDNodeFlags Flags);
978 
979  // Use flags from current flag inserter.
980  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
981  ArrayRef<SDValue> Ops);
982  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList,
983  ArrayRef<SDValue> Ops);
984  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue Operand);
985  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1,
986  SDValue N2);
987  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1,
988  SDValue N2, SDValue N3);
989 
990  // Specialize based on number of operands.
991  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT);
992  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue Operand,
993  const SDNodeFlags Flags);
994  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1,
995  SDValue N2, const SDNodeFlags Flags);
996  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1,
997  SDValue N2, SDValue N3, const SDNodeFlags Flags);
998  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1,
999  SDValue N2, SDValue N3, SDValue N4);
1000  SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1,
1001  SDValue N2, SDValue N3, SDValue N4, SDValue N5);
1002 
1003  // Specialize again based on number of operands for nodes with a VTList
1004  // rather than a single VT.
1005  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList);
1006  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList, SDValue N);
1007  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList, SDValue N1,
1008  SDValue N2);
1009  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList, SDValue N1,
1010  SDValue N2, SDValue N3);
1011  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList, SDValue N1,
1012  SDValue N2, SDValue N3, SDValue N4);
1013  SDValue getNode(unsigned Opcode, const SDLoc &DL, SDVTList VTList, SDValue N1,
1014  SDValue N2, SDValue N3, SDValue N4, SDValue N5);
1015 
1016  /// Compute a TokenFactor to force all the incoming stack arguments to be
1017  /// loaded from the stack. This is used in tail call lowering to protect
1018  /// stack arguments from being clobbered.
1020 
1021  SDValue getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src,
1022  SDValue Size, Align Alignment, bool isVol,
1023  bool AlwaysInline, bool isTailCall,
1024  MachinePointerInfo DstPtrInfo,
1025  MachinePointerInfo SrcPtrInfo,
1026  const AAMDNodes &AAInfo = AAMDNodes());
1027 
1028  SDValue getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src,
1029  SDValue Size, Align Alignment, bool isVol, bool isTailCall,
1030  MachinePointerInfo DstPtrInfo,
1031  MachinePointerInfo SrcPtrInfo,
1032  const AAMDNodes &AAInfo = AAMDNodes());
1033 
1034  SDValue getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src,
1035  SDValue Size, Align Alignment, bool isVol, bool isTailCall,
1036  MachinePointerInfo DstPtrInfo,
1037  const AAMDNodes &AAInfo = AAMDNodes());
1038 
1039  SDValue getAtomicMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst,
1040  unsigned DstAlign, SDValue Src, unsigned SrcAlign,
1041  SDValue Size, Type *SizeTy, unsigned ElemSz,
1042  bool isTailCall, MachinePointerInfo DstPtrInfo,
1043  MachinePointerInfo SrcPtrInfo);
1044 
1045  SDValue getAtomicMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst,
1046  unsigned DstAlign, SDValue Src, unsigned SrcAlign,
1047  SDValue Size, Type *SizeTy, unsigned ElemSz,
1048  bool isTailCall, MachinePointerInfo DstPtrInfo,
1049  MachinePointerInfo SrcPtrInfo);
1050 
1051  SDValue getAtomicMemset(SDValue Chain, const SDLoc &dl, SDValue Dst,
1052  unsigned DstAlign, SDValue Value, SDValue Size,
1053  Type *SizeTy, unsigned ElemSz, bool isTailCall,
1054  MachinePointerInfo DstPtrInfo);
1055 
1056  /// Helper function to make it easier to build SetCC's if you just have an
1057  /// ISD::CondCode instead of an SDValue.
1058  SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS,
1059  ISD::CondCode Cond, SDValue Chain = SDValue(),
1060  bool IsSignaling = false) {
1061  assert(LHS.getValueType().isVector() == RHS.getValueType().isVector() &&
1062  "Cannot compare scalars to vectors");
1063  assert(LHS.getValueType().isVector() == VT.isVector() &&
1064  "Cannot compare scalars to vectors");
1066  "Cannot create a setCC of an invalid node.");
1067  if (Chain)
1068  return getNode(IsSignaling ? ISD::STRICT_FSETCCS : ISD::STRICT_FSETCC, DL,
1069  {VT, MVT::Other}, {Chain, LHS, RHS, getCondCode(Cond)});
1070  return getNode(ISD::SETCC, DL, VT, LHS, RHS, getCondCode(Cond));
1071  }
1072 
1073  /// Helper function to make it easier to build Select's if you just have
1074  /// operands and don't want to check for vector.
1076  SDValue RHS) {
1077  assert(LHS.getValueType() == RHS.getValueType() &&
1078  "Cannot use select on differing types");
1079  assert(VT.isVector() == LHS.getValueType().isVector() &&
1080  "Cannot mix vectors and scalars");
1081  auto Opcode = Cond.getValueType().isVector() ? ISD::VSELECT : ISD::SELECT;
1082  return getNode(Opcode, DL, VT, Cond, LHS, RHS);
1083  }
1084 
1085  /// Helper function to make it easier to build SelectCC's if you just have an
1086  /// ISD::CondCode instead of an SDValue.
1088  SDValue False, ISD::CondCode Cond) {
1089  return getNode(ISD::SELECT_CC, DL, True.getValueType(), LHS, RHS, True,
1090  False, getCondCode(Cond));
1091  }
1092 
1093  /// Try to simplify a select/vselect into 1 of its operands or a constant.
1095 
1096  /// Try to simplify a shift into 1 of its operands or a constant.
1098 
1099  /// Try to simplify a floating-point binary operation into 1 of its operands
1100  /// or a constant.
1101  SDValue simplifyFPBinop(unsigned Opcode, SDValue X, SDValue Y,
1102  SDNodeFlags Flags);
1103 
1104  /// VAArg produces a result and token chain, and takes a pointer
1105  /// and a source value as input.
1106  SDValue getVAArg(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
1107  SDValue SV, unsigned Align);
1108 
1109  /// Gets a node for an atomic cmpxchg op. There are two
1110  /// valid Opcodes. ISD::ATOMIC_CMO_SWAP produces the value loaded and a
1111  /// chain result. ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS produces the value loaded,
1112  /// a success flag (initially i1), and a chain.
1113  SDValue getAtomicCmpSwap(unsigned Opcode, const SDLoc &dl, EVT MemVT,
1114  SDVTList VTs, SDValue Chain, SDValue Ptr,
1115  SDValue Cmp, SDValue Swp, MachineMemOperand *MMO);
1116 
1117  /// Gets a node for an atomic op, produces result (if relevant)
1118  /// and chain and takes 2 operands.
1119  SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT, SDValue Chain,
1120  SDValue Ptr, SDValue Val, MachineMemOperand *MMO);
1121 
1122  /// Gets a node for an atomic op, produces result and chain and
1123  /// takes 1 operand.
1124  SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT, EVT VT,
1125  SDValue Chain, SDValue Ptr, MachineMemOperand *MMO);
1126 
1127  /// Gets a node for an atomic op, produces result and chain and takes N
1128  /// operands.
1129  SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT,
1130  SDVTList VTList, ArrayRef<SDValue> Ops,
1131  MachineMemOperand *MMO);
1132 
1133  /// Creates a MemIntrinsicNode that may produce a
1134  /// result and takes a list of operands. Opcode may be INTRINSIC_VOID,
1135  /// INTRINSIC_W_CHAIN, or a target-specific opcode with a value not
1136  /// less than FIRST_TARGET_MEMORY_OPCODE.
1138  unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef<SDValue> Ops,
1139  EVT MemVT, MachinePointerInfo PtrInfo, Align Alignment,
1142  uint64_t Size = 0, const AAMDNodes &AAInfo = AAMDNodes());
1143 
1145  unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef<SDValue> Ops,
1146  EVT MemVT, MachinePointerInfo PtrInfo, MaybeAlign Alignment = None,
1149  uint64_t Size = 0, const AAMDNodes &AAInfo = AAMDNodes()) {
1150  // Ensure that codegen never sees alignment 0
1151  return getMemIntrinsicNode(Opcode, dl, VTList, Ops, MemVT, PtrInfo,
1152  Alignment.getValueOr(getEVTAlign(MemVT)), Flags,
1153  Size, AAInfo);
1154  }
1155 
1156  SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList,
1157  ArrayRef<SDValue> Ops, EVT MemVT,
1158  MachineMemOperand *MMO);
1159 
1160  /// Creates a LifetimeSDNode that starts (`IsStart==true`) or ends
1161  /// (`IsStart==false`) the lifetime of the portion of `FrameIndex` between
1162  /// offsets `Offset` and `Offset + Size`.
1163  SDValue getLifetimeNode(bool IsStart, const SDLoc &dl, SDValue Chain,
1164  int FrameIndex, int64_t Size, int64_t Offset = -1);
1165 
1166  /// Creates a PseudoProbeSDNode with function GUID `Guid` and
1167  /// the index of the block `Index` it is probing, as well as the attributes
1168  /// `attr` of the probe.
1169  SDValue getPseudoProbeNode(const SDLoc &Dl, SDValue Chain, uint64_t Guid,
1170  uint64_t Index, uint32_t Attr);
1171 
1172  /// Create a MERGE_VALUES node from the given operands.
1174 
1175  /// Loads are not normal binary operators: their result type is not
1176  /// determined by their operands, and they produce a value AND a token chain.
1177  ///
1178  /// This function will set the MOLoad flag on MMOFlags, but you can set it if
1179  /// you want. The MOStore flag must not be set.
1180  SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
1181  MachinePointerInfo PtrInfo,
1182  MaybeAlign Alignment = MaybeAlign(),
1184  const AAMDNodes &AAInfo = AAMDNodes(),
1185  const MDNode *Ranges = nullptr);
1186  /// FIXME: Remove once transition to Align is over.
1187  inline SDValue
1188  getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
1189  MachinePointerInfo PtrInfo, unsigned Alignment,
1191  const AAMDNodes &AAInfo = AAMDNodes(),
1192  const MDNode *Ranges = nullptr) {
1193  return getLoad(VT, dl, Chain, Ptr, PtrInfo, MaybeAlign(Alignment), MMOFlags,
1194  AAInfo, Ranges);
1195  }
1196  SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
1197  MachineMemOperand *MMO);
1198  SDValue
1199  getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain,
1200  SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT,
1201  MaybeAlign Alignment = MaybeAlign(),
1203  const AAMDNodes &AAInfo = AAMDNodes());
1204  /// FIXME: Remove once transition to Align is over.
1205  inline SDValue
1206  getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain,
1207  SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT,
1208  unsigned Alignment,
1210  const AAMDNodes &AAInfo = AAMDNodes()) {
1211  return getExtLoad(ExtType, dl, VT, Chain, Ptr, PtrInfo, MemVT,
1212  MaybeAlign(Alignment), MMOFlags, AAInfo);
1213  }
1214  SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT,
1215  SDValue Chain, SDValue Ptr, EVT MemVT,
1216  MachineMemOperand *MMO);
1217  SDValue getIndexedLoad(SDValue OrigLoad, const SDLoc &dl, SDValue Base,
1220  const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue Offset,
1221  MachinePointerInfo PtrInfo, EVT MemVT, Align Alignment,
1223  const AAMDNodes &AAInfo = AAMDNodes(),
1224  const MDNode *Ranges = nullptr);
1226  ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT, const SDLoc &dl,
1227  SDValue Chain, SDValue Ptr, SDValue Offset, MachinePointerInfo PtrInfo,
1228  EVT MemVT, MaybeAlign Alignment = MaybeAlign(),
1230  const AAMDNodes &AAInfo = AAMDNodes(), const MDNode *Ranges = nullptr) {
1231  // Ensures that codegen never sees a None Alignment.
1232  return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, PtrInfo, MemVT,
1233  Alignment.getValueOr(getEVTAlign(MemVT)), MMOFlags, AAInfo,
1234  Ranges);
1235  }
1236  /// FIXME: Remove once transition to Align is over.
1237  inline SDValue
1239  const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue Offset,
1240  MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment,
1242  const AAMDNodes &AAInfo = AAMDNodes(),
1243  const MDNode *Ranges = nullptr) {
1244  return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, PtrInfo, MemVT,
1245  MaybeAlign(Alignment), MMOFlags, AAInfo, Ranges);
1246  }
1248  const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue Offset,
1249  EVT MemVT, MachineMemOperand *MMO);
1250 
1251  /// Helper function to build ISD::STORE nodes.
1252  ///
1253  /// This function will set the MOStore flag on MMOFlags, but you can set it if
1254  /// you want. The MOLoad and MOInvariant flags must not be set.
1255 
1256  SDValue
1257  getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
1258  MachinePointerInfo PtrInfo, Align Alignment,
1260  const AAMDNodes &AAInfo = AAMDNodes());
1261  inline SDValue
1262  getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
1263  MachinePointerInfo PtrInfo, MaybeAlign Alignment = MaybeAlign(),
1265  const AAMDNodes &AAInfo = AAMDNodes()) {
1266  return getStore(Chain, dl, Val, Ptr, PtrInfo,
1267  Alignment.getValueOr(getEVTAlign(Val.getValueType())),
1268  MMOFlags, AAInfo);
1269  }
1270  /// FIXME: Remove once transition to Align is over.
1271  inline SDValue
1272  getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
1273  MachinePointerInfo PtrInfo, unsigned Alignment,
1275  const AAMDNodes &AAInfo = AAMDNodes()) {
1276  return getStore(Chain, dl, Val, Ptr, PtrInfo, MaybeAlign(Alignment),
1277  MMOFlags, AAInfo);
1278  }
1279  SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
1280  MachineMemOperand *MMO);
1281  SDValue
1282  getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
1283  MachinePointerInfo PtrInfo, EVT SVT, Align Alignment,
1285  const AAMDNodes &AAInfo = AAMDNodes());
1286  inline SDValue
1287  getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
1288  MachinePointerInfo PtrInfo, EVT SVT,
1289  MaybeAlign Alignment = MaybeAlign(),
1291  const AAMDNodes &AAInfo = AAMDNodes()) {
1292  return getTruncStore(Chain, dl, Val, Ptr, PtrInfo, SVT,
1293  Alignment.getValueOr(getEVTAlign(SVT)), MMOFlags,
1294  AAInfo);
1295  }
1296  /// FIXME: Remove once transition to Align is over.
1297  inline SDValue
1298  getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr,
1299  MachinePointerInfo PtrInfo, EVT SVT, unsigned Alignment,
1301  const AAMDNodes &AAInfo = AAMDNodes()) {
1302  return getTruncStore(Chain, dl, Val, Ptr, PtrInfo, SVT,
1303  MaybeAlign(Alignment), MMOFlags, AAInfo);
1304  }
1305  SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val,
1306  SDValue Ptr, EVT SVT, MachineMemOperand *MMO);
1307  SDValue getIndexedStore(SDValue OrigStore, const SDLoc &dl, SDValue Base,
1309 
1310  SDValue getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Base,
1311  SDValue Offset, SDValue Mask, SDValue Src0, EVT MemVT,
1313  ISD::LoadExtType, bool IsExpanding = false);
1314  SDValue getIndexedMaskedLoad(SDValue OrigLoad, const SDLoc &dl, SDValue Base,
1316  SDValue getMaskedStore(SDValue Chain, const SDLoc &dl, SDValue Val,
1319  bool IsTruncating = false, bool IsCompressing = false);
1320  SDValue getIndexedMaskedStore(SDValue OrigStore, const SDLoc &dl,
1322  ISD::MemIndexedMode AM);
1323  SDValue getMaskedGather(SDVTList VTs, EVT MemVT, const SDLoc &dl,
1325  ISD::MemIndexType IndexType, ISD::LoadExtType ExtTy);
1326  SDValue getMaskedScatter(SDVTList VTs, EVT MemVT, const SDLoc &dl,
1328  ISD::MemIndexType IndexType,
1329  bool IsTruncating = false);
1330 
1331  /// Construct a node to track a Value* through the backend.
1332  SDValue getSrcValue(const Value *v);
1333 
1334  /// Return an MDNodeSDNode which holds an MDNode.
1335  SDValue getMDNode(const MDNode *MD);
1336 
1337  /// Return a bitcast using the SDLoc of the value operand, and casting to the
1338  /// provided type. Use getNode to set a custom SDLoc.
1339  SDValue getBitcast(EVT VT, SDValue V);
1340 
1341  /// Return an AddrSpaceCastSDNode.
1342  SDValue getAddrSpaceCast(const SDLoc &dl, EVT VT, SDValue Ptr, unsigned SrcAS,
1343  unsigned DestAS);
1344 
1345  /// Return a freeze using the SDLoc of the value operand.
1347 
1348  /// Return an AssertAlignSDNode.
1350 
1351  /// Return the specified value casted to
1352  /// the target's desired shift amount type.
1354 
1355  /// Expand the specified \c ISD::VAARG node as the Legalize pass would.
1357 
1358  /// Expand the specified \c ISD::VACOPY node as the Legalize pass would.
1360 
1361  /// Returs an GlobalAddress of the function from the current module with
1362  /// name matching the given ExternalSymbol. Additionally can provide the
1363  /// matched function.
1364  /// Panics the function doesn't exists.
1366  Function **TargetFunction = nullptr);
1367 
1368  /// *Mutate* the specified node in-place to have the
1369  /// specified operands. If the resultant node already exists in the DAG,
1370  /// this does not modify the specified node, instead it returns the node that
1371  /// already exists. If the resultant node does not exist in the DAG, the
1372  /// input node is returned. As a degenerate case, if you specify the same
1373  /// input operands as the node already has, the input node is returned.
1377  SDValue Op3);
1379  SDValue Op3, SDValue Op4);
1381  SDValue Op3, SDValue Op4, SDValue Op5);
1383 
1384  /// Creates a new TokenFactor containing \p Vals. If \p Vals contains 64k
1385  /// values or more, move values into new TokenFactors in 64k-1 blocks, until
1386  /// the final TokenFactor has less than 64k operands.
1388 
1389  /// *Mutate* the specified machine node's memory references to the provided
1390  /// list.
1392  ArrayRef<MachineMemOperand *> NewMemRefs);
1393 
1394  // Calculate divergence of node \p N based on its operands.
1395  bool calculateDivergence(SDNode *N);
1396 
1397  // Propagates the change in divergence to users
1398  void updateDivergence(SDNode * N);
1399 
1400  /// These are used for target selectors to *mutate* the
1401  /// specified node to have the specified return type, Target opcode, and
1402  /// operands. Note that target opcodes are stored as
1403  /// ~TargetOpcode in the node opcode field. The resultant node is returned.
1404  SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT);
1405  SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT, SDValue Op1);
1406  SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT,
1407  SDValue Op1, SDValue Op2);
1408  SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT,
1409  SDValue Op1, SDValue Op2, SDValue Op3);
1410  SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT,
1411  ArrayRef<SDValue> Ops);
1412  SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT1, EVT VT2);
1413  SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT1,
1414  EVT VT2, ArrayRef<SDValue> Ops);
1415  SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT1,
1416  EVT VT2, EVT VT3, ArrayRef<SDValue> Ops);
1417  SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT1,
1418  EVT VT2, SDValue Op1, SDValue Op2);
1419  SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, SDVTList VTs,
1420  ArrayRef<SDValue> Ops);
1421 
1422  /// This *mutates* the specified node to have the specified
1423  /// return type, opcode, and operands.
1424  SDNode *MorphNodeTo(SDNode *N, unsigned Opc, SDVTList VTs,
1425  ArrayRef<SDValue> Ops);
1426 
1427  /// Mutate the specified strict FP node to its non-strict equivalent,
1428  /// unlinking the node from its chain and dropping the metadata arguments.
1429  /// The node must be a strict FP node.
1431 
1432  /// These are used for target selectors to create a new node
1433  /// with specified return type(s), MachineInstr opcode, and operands.
1434  ///
1435  /// Note that getMachineNode returns the resultant node. If there is already
1436  /// a node of the specified opcode and operands, it returns that node instead
1437  /// of the current one.
1438  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT);
1439  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT,
1440  SDValue Op1);
1441  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT,
1442  SDValue Op1, SDValue Op2);
1443  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT,
1444  SDValue Op1, SDValue Op2, SDValue Op3);
1445  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT,
1446  ArrayRef<SDValue> Ops);
1447  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
1448  EVT VT2, SDValue Op1, SDValue Op2);
1449  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
1450  EVT VT2, SDValue Op1, SDValue Op2, SDValue Op3);
1451  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
1452  EVT VT2, ArrayRef<SDValue> Ops);
1453  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
1454  EVT VT2, EVT VT3, SDValue Op1, SDValue Op2);
1455  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
1456  EVT VT2, EVT VT3, SDValue Op1, SDValue Op2,
1457  SDValue Op3);
1458  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT1,
1459  EVT VT2, EVT VT3, ArrayRef<SDValue> Ops);
1460  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl,
1461  ArrayRef<EVT> ResultTys, ArrayRef<SDValue> Ops);
1462  MachineSDNode *getMachineNode(unsigned Opcode, const SDLoc &dl, SDVTList VTs,
1463  ArrayRef<SDValue> Ops);
1464 
1465  /// A convenience function for creating TargetInstrInfo::EXTRACT_SUBREG nodes.
1466  SDValue getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT,
1467  SDValue Operand);
1468 
1469  /// A convenience function for creating TargetInstrInfo::INSERT_SUBREG nodes.
1470  SDValue getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT,
1471  SDValue Operand, SDValue Subreg);
1472 
1473  /// Get the specified node if it's already available, or else return NULL.
1474  SDNode *getNodeIfExists(unsigned Opcode, SDVTList VTList,
1475  ArrayRef<SDValue> Ops, const SDNodeFlags Flags);
1476  SDNode *getNodeIfExists(unsigned Opcode, SDVTList VTList,
1477  ArrayRef<SDValue> Ops);
1478 
1479  /// Check if a node exists without modifying its flags.
1480  bool doesNodeExist(unsigned Opcode, SDVTList VTList, ArrayRef<SDValue> Ops);
1481 
1482  /// Creates a SDDbgValue node.
1484  unsigned R, bool IsIndirect, const DebugLoc &DL,
1485  unsigned O);
1486 
1487  /// Creates a constant SDDbgValue node.
1489  const Value *C, const DebugLoc &DL,
1490  unsigned O);
1491 
1492  /// Creates a FrameIndex SDDbgValue node.
1494  unsigned FI, bool IsIndirect,
1495  const DebugLoc &DL, unsigned O);
1496 
1497  /// Creates a FrameIndex SDDbgValue node.
1499  unsigned FI,
1500  ArrayRef<SDNode *> Dependencies,
1501  bool IsIndirect, const DebugLoc &DL,
1502  unsigned O);
1503 
1504  /// Creates a VReg SDDbgValue node.
1506  unsigned VReg, bool IsIndirect,
1507  const DebugLoc &DL, unsigned O);
1508 
1509  /// Creates a SDDbgValue node from a list of locations.
1512  ArrayRef<SDNode *> Dependencies, bool IsIndirect,
1513  const DebugLoc &DL, unsigned O, bool IsVariadic);
1514 
1515  /// Creates a SDDbgLabel node.
1516  SDDbgLabel *getDbgLabel(DILabel *Label, const DebugLoc &DL, unsigned O);
1517 
1518  /// Transfer debug values from one node to another, while optionally
1519  /// generating fragment expressions for split-up values. If \p InvalidateDbg
1520  /// is set, debug values are invalidated after they are transferred.
1521  void transferDbgValues(SDValue From, SDValue To, unsigned OffsetInBits = 0,
1522  unsigned SizeInBits = 0, bool InvalidateDbg = true);
1523 
1524  /// Remove the specified node from the system. If any of its
1525  /// operands then becomes dead, remove them as well. Inform UpdateListener
1526  /// for each node deleted.
1527  void RemoveDeadNode(SDNode *N);
1528 
1529  /// This method deletes the unreachable nodes in the
1530  /// given list, and any nodes that become unreachable as a result.
1531  void RemoveDeadNodes(SmallVectorImpl<SDNode *> &DeadNodes);
1532 
1533  /// Modify anything using 'From' to use 'To' instead.
1534  /// This can cause recursive merging of nodes in the DAG. Use the first
1535  /// version if 'From' is known to have a single result, use the second
1536  /// if you have two nodes with identical results (or if 'To' has a superset
1537  /// of the results of 'From'), use the third otherwise.
1538  ///
1539  /// These methods all take an optional UpdateListener, which (if not null) is
1540  /// informed about nodes that are deleted and modified due to recursive
1541  /// changes in the dag.
1542  ///
1543  /// These functions only replace all existing uses. It's possible that as
1544  /// these replacements are being performed, CSE may cause the From node
1545  /// to be given new uses. These new uses of From are left in place, and
1546  /// not automatically transferred to To.
1547  ///
1549  void ReplaceAllUsesWith(SDNode *From, SDNode *To);
1550  void ReplaceAllUsesWith(SDNode *From, const SDValue *To);
1551 
1552  /// Replace any uses of From with To, leaving
1553  /// uses of other values produced by From.getNode() alone.
1555 
1556  /// Like ReplaceAllUsesOfValueWith, but for multiple values at once.
1557  /// This correctly handles the case where
1558  /// there is an overlap between the From values and the To values.
1559  void ReplaceAllUsesOfValuesWith(const SDValue *From, const SDValue *To,
1560  unsigned Num);
1561 
1562  /// If an existing load has uses of its chain, create a token factor node with
1563  /// that chain and the new memory node's chain and update users of the old
1564  /// chain to the token factor. This ensures that the new memory node will have
1565  /// the same relative memory dependency position as the old load. Returns the
1566  /// new merged load chain.
1567  SDValue makeEquivalentMemoryOrdering(SDValue OldChain, SDValue NewMemOpChain);
1568 
1569  /// If an existing load has uses of its chain, create a token factor node with
1570  /// that chain and the new memory node's chain and update users of the old
1571  /// chain to the token factor. This ensures that the new memory node will have
1572  /// the same relative memory dependency position as the old load. Returns the
1573  /// new merged load chain.
1575 
1576  /// Topological-sort the AllNodes list and a
1577  /// assign a unique node id for each node in the DAG based on their
1578  /// topological order. Returns the number of nodes.
1579  unsigned AssignTopologicalOrder();
1580 
1581  /// Move node N in the AllNodes list to be immediately
1582  /// before the given iterator Position. This may be used to update the
1583  /// topological ordering when the list of nodes is modified.
1585  AllNodes.insert(Position, AllNodes.remove(N));
1586  }
1587 
1588  /// Returns an APFloat semantics tag appropriate for the given type. If VT is
1589  /// a vector type, the element semantics are returned.
1591  switch (VT.getScalarType().getSimpleVT().SimpleTy) {
1592  default: llvm_unreachable("Unknown FP format");
1593  case MVT::f16: return APFloat::IEEEhalf();
1594  case MVT::bf16: return APFloat::BFloat();
1595  case MVT::f32: return APFloat::IEEEsingle();
1596  case MVT::f64: return APFloat::IEEEdouble();
1597  case MVT::f80: return APFloat::x87DoubleExtended();
1598  case MVT::f128: return APFloat::IEEEquad();
1599  case MVT::ppcf128: return APFloat::PPCDoubleDouble();
1600  }
1601  }
1602 
1603  /// Add a dbg_value SDNode. If SD is non-null that means the
1604  /// value is produced by SD.
1605  void AddDbgValue(SDDbgValue *DB, bool isParameter);
1606 
1607  /// Add a dbg_label SDNode.
1608  void AddDbgLabel(SDDbgLabel *DB);
1609 
1610  /// Get the debug values which reference the given SDNode.
1612  return DbgInfo->getSDDbgValues(SD);
1613  }
1614 
1615 public:
1616  /// Return true if there are any SDDbgValue nodes associated
1617  /// with this SelectionDAG.
1618  bool hasDebugValues() const { return !DbgInfo->empty(); }
1619 
1620  SDDbgInfo::DbgIterator DbgBegin() const { return DbgInfo->DbgBegin(); }
1621  SDDbgInfo::DbgIterator DbgEnd() const { return DbgInfo->DbgEnd(); }
1622 
1624  return DbgInfo->ByvalParmDbgBegin();
1625  }
1627  return DbgInfo->ByvalParmDbgEnd();
1628  }
1629 
1631  return DbgInfo->DbgLabelBegin();
1632  }
1634  return DbgInfo->DbgLabelEnd();
1635  }
1636 
1637  /// To be invoked on an SDNode that is slated to be erased. This
1638  /// function mirrors \c llvm::salvageDebugInfo.
1639  void salvageDebugInfo(SDNode &N);
1640 
1641  void dump() const;
1642 
1643  /// In most cases this function returns the ABI alignment for a given type,
1644  /// except for illegal vector types where the alignment exceeds that of the
1645  /// stack. In such cases we attempt to break the vector down to a legal type
1646  /// and return the ABI alignment for that instead.
1647  Align getReducedAlign(EVT VT, bool UseABI);
1648 
1649  /// Create a stack temporary based on the size in bytes and the alignment
1650  SDValue CreateStackTemporary(TypeSize Bytes, Align Alignment);
1651 
1652  /// Create a stack temporary, suitable for holding the specified value type.
1653  /// If minAlign is specified, the slot size will have at least that alignment.
1654  SDValue CreateStackTemporary(EVT VT, unsigned minAlign = 1);
1655 
1656  /// Create a stack temporary suitable for holding either of the specified
1657  /// value types.
1658  SDValue CreateStackTemporary(EVT VT1, EVT VT2);
1659 
1660  SDValue FoldSymbolOffset(unsigned Opcode, EVT VT,
1661  const GlobalAddressSDNode *GA,
1662  const SDNode *N2);
1663 
1664  SDValue FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL, EVT VT,
1665  ArrayRef<SDValue> Ops);
1666 
1667  SDValue FoldConstantVectorArithmetic(unsigned Opcode, const SDLoc &DL, EVT VT,
1668  ArrayRef<SDValue> Ops,
1669  const SDNodeFlags Flags = SDNodeFlags());
1670 
1671  /// Fold floating-point operations with 2 operands when both operands are
1672  /// constants and/or undefined.
1673  SDValue foldConstantFPMath(unsigned Opcode, const SDLoc &DL, EVT VT,
1674  SDValue N1, SDValue N2);
1675 
1676  /// Constant fold a setcc to true or false.
1678  const SDLoc &dl);
1679 
1680  /// See if the specified operand can be simplified with the knowledge that
1681  /// only the bits specified by DemandedBits are used. If so, return the
1682  /// simpler operand, otherwise return a null SDValue.
1683  ///
1684  /// (This exists alongside SimplifyDemandedBits because GetDemandedBits can
1685  /// simplify nodes with multiple uses more aggressively.)
1687 
1688  /// See if the specified operand can be simplified with the knowledge that
1689  /// only the bits specified by DemandedBits are used in the elements specified
1690  /// by DemandedElts. If so, return the simpler operand, otherwise return a
1691  /// null SDValue.
1692  ///
1693  /// (This exists alongside SimplifyDemandedBits because GetDemandedBits can
1694  /// simplify nodes with multiple uses more aggressively.)
1696  const APInt &DemandedElts);
1697 
1698  /// Return true if the sign bit of Op is known to be zero.
1699  /// We use this predicate to simplify operations downstream.
1700  bool SignBitIsZero(SDValue Op, unsigned Depth = 0) const;
1701 
1702  /// Return true if 'Op & Mask' is known to be zero. We
1703  /// use this predicate to simplify operations downstream. Op and Mask are
1704  /// known to be the same type.
1705  bool MaskedValueIsZero(SDValue Op, const APInt &Mask,
1706  unsigned Depth = 0) const;
1707 
1708  /// Return true if 'Op & Mask' is known to be zero in DemandedElts. We
1709  /// use this predicate to simplify operations downstream. Op and Mask are
1710  /// known to be the same type.
1711  bool MaskedValueIsZero(SDValue Op, const APInt &Mask,
1712  const APInt &DemandedElts, unsigned Depth = 0) const;
1713 
1714  /// Return true if '(Op & Mask) == Mask'.
1715  /// Op and Mask are known to be the same type.
1716  bool MaskedValueIsAllOnes(SDValue Op, const APInt &Mask,
1717  unsigned Depth = 0) const;
1718 
1719  /// Determine which bits of Op are known to be either zero or one and return
1720  /// them in Known. For vectors, the known bits are those that are shared by
1721  /// every vector element.
1722  /// Targets can implement the computeKnownBitsForTargetNode method in the
1723  /// TargetLowering class to allow target nodes to be understood.
1724  KnownBits computeKnownBits(SDValue Op, unsigned Depth = 0) const;
1725 
1726  /// Determine which bits of Op are known to be either zero or one and return
1727  /// them in Known. The DemandedElts argument allows us to only collect the
1728  /// known bits that are shared by the requested vector elements.
1729  /// Targets can implement the computeKnownBitsForTargetNode method in the
1730  /// TargetLowering class to allow target nodes to be understood.
1731  KnownBits computeKnownBits(SDValue Op, const APInt &DemandedElts,
1732  unsigned Depth = 0) const;
1733 
1734  /// Used to represent the possible overflow behavior of an operation.
1735  /// Never: the operation cannot overflow.
1736  /// Always: the operation will always overflow.
1737  /// Sometime: the operation may or may not overflow.
1742  };
1743 
1744  /// Determine if the result of the addition of 2 node can overflow.
1746 
1747  /// Test if the given value is known to have exactly one bit set. This differs
1748  /// from computeKnownBits in that it doesn't necessarily determine which bit
1749  /// is set.
1750  bool isKnownToBeAPowerOfTwo(SDValue Val) const;
1751 
1752  /// Return the number of times the sign bit of the register is replicated into
1753  /// the other bits. We know that at least 1 bit is always equal to the sign
1754  /// bit (itself), but other cases can give us information. For example,
1755  /// immediately after an "SRA X, 2", we know that the top 3 bits are all equal
1756  /// to each other, so we return 3. Targets can implement the
1757  /// ComputeNumSignBitsForTarget method in the TargetLowering class to allow
1758  /// target nodes to be understood.
1759  unsigned ComputeNumSignBits(SDValue Op, unsigned Depth = 0) const;
1760 
1761  /// Return the number of times the sign bit of the register is replicated into
1762  /// the other bits. We know that at least 1 bit is always equal to the sign
1763  /// bit (itself), but other cases can give us information. For example,
1764  /// immediately after an "SRA X, 2", we know that the top 3 bits are all equal
1765  /// to each other, so we return 3. The DemandedElts argument allows
1766  /// us to only collect the minimum sign bits of the requested vector elements.
1767  /// Targets can implement the ComputeNumSignBitsForTarget method in the
1768  /// TargetLowering class to allow target nodes to be understood.
1769  unsigned ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
1770  unsigned Depth = 0) const;
1771 
1772  /// Return true if this function can prove that \p Op is never poison
1773  /// and, if \p PoisonOnly is false, does not have undef bits.
1774  bool isGuaranteedNotToBeUndefOrPoison(SDValue Op, bool PoisonOnly = false,
1775  unsigned Depth = 0) const;
1776 
1777  /// Return true if this function can prove that \p Op is never poison
1778  /// and, if \p PoisonOnly is false, does not have undef bits. The DemandedElts
1779  /// argument limits the check to the requested vector elements.
1780  bool isGuaranteedNotToBeUndefOrPoison(SDValue Op, const APInt &DemandedElts,
1781  bool PoisonOnly = false,
1782  unsigned Depth = 0) const;
1783 
1784  /// Return true if this function can prove that \p Op is never poison.
1785  bool isGuaranteedNotToBePoison(SDValue Op, unsigned Depth = 0) const {
1786  return isGuaranteedNotToBeUndefOrPoison(Op, /*PoisonOnly*/ true, Depth);
1787  }
1788 
1789  /// Return true if this function can prove that \p Op is never poison. The
1790  /// DemandedElts argument limits the check to the requested vector elements.
1791  bool isGuaranteedNotToBePoison(SDValue Op, const APInt &DemandedElts,
1792  unsigned Depth = 0) const {
1793  return isGuaranteedNotToBeUndefOrPoison(Op, DemandedElts,
1794  /*PoisonOnly*/ true, Depth);
1795  }
1796 
1797  /// Return true if the specified operand is an ISD::ADD with a ConstantSDNode
1798  /// on the right-hand side, or if it is an ISD::OR with a ConstantSDNode that
1799  /// is guaranteed to have the same semantics as an ADD. This handles the
1800  /// equivalence:
1801  /// X|Cst == X+Cst iff X&Cst = 0.
1802  bool isBaseWithConstantOffset(SDValue Op) const;
1803 
1804  /// Test whether the given SDValue is known to never be NaN. If \p SNaN is
1805  /// true, returns if \p Op is known to never be a signaling NaN (it may still
1806  /// be a qNaN).
1807  bool isKnownNeverNaN(SDValue Op, bool SNaN = false, unsigned Depth = 0) const;
1808 
1809  /// \returns true if \p Op is known to never be a signaling NaN.
1810  bool isKnownNeverSNaN(SDValue Op, unsigned Depth = 0) const {
1811  return isKnownNeverNaN(Op, true, Depth);
1812  }
1813 
1814  /// Test whether the given floating point SDValue is known to never be
1815  /// positive or negative zero.
1816  bool isKnownNeverZeroFloat(SDValue Op) const;
1817 
1818  /// Test whether the given SDValue is known to contain non-zero value(s).
1819  bool isKnownNeverZero(SDValue Op) const;
1820 
1821  /// Test whether two SDValues are known to compare equal. This
1822  /// is true if they are the same value, or if one is negative zero and the
1823  /// other positive zero.
1824  bool isEqualTo(SDValue A, SDValue B) const;
1825 
1826  /// Return true if A and B have no common bits set. As an example, this can
1827  /// allow an 'add' to be transformed into an 'or'.
1828  bool haveNoCommonBitsSet(SDValue A, SDValue B) const;
1829 
1830  /// Test whether \p V has a splatted value for all the demanded elements.
1831  ///
1832  /// On success \p UndefElts will indicate the elements that have UNDEF
1833  /// values instead of the splat value, this is only guaranteed to be correct
1834  /// for \p DemandedElts.
1835  ///
1836  /// NOTE: The function will return true for a demanded splat of UNDEF values.
1837  bool isSplatValue(SDValue V, const APInt &DemandedElts, APInt &UndefElts,
1838  unsigned Depth = 0);
1839 
1840  /// Test whether \p V has a splatted value.
1841  bool isSplatValue(SDValue V, bool AllowUndefs = false);
1842 
1843  /// If V is a splatted value, return the source vector and its splat index.
1844  SDValue getSplatSourceVector(SDValue V, int &SplatIndex);
1845 
1846  /// If V is a splat vector, return its scalar source operand by extracting
1847  /// that element from the source vector. If LegalTypes is true, this method
1848  /// may only return a legally-typed splat value. If it cannot legalize the
1849  /// splatted value it will return SDValue().
1850  SDValue getSplatValue(SDValue V, bool LegalTypes = false);
1851 
1852  /// If a SHL/SRA/SRL node \p V has a constant or splat constant shift amount
1853  /// that is less than the element bit-width of the shift node, return it.
1855  const APInt &DemandedElts) const;
1856 
1857  /// If a SHL/SRA/SRL node \p V has constant shift amounts that are all less
1858  /// than the element bit-width of the shift node, return the minimum value.
1859  const APInt *
1861  const APInt &DemandedElts) const;
1862 
1863  /// If a SHL/SRA/SRL node \p V has constant shift amounts that are all less
1864  /// than the element bit-width of the shift node, return the maximum value.
1865  const APInt *
1867  const APInt &DemandedElts) const;
1868 
1869  /// Match a binop + shuffle pyramid that represents a horizontal reduction
1870  /// over the elements of a vector starting from the EXTRACT_VECTOR_ELT node /p
1871  /// Extract. The reduction must use one of the opcodes listed in /p
1872  /// CandidateBinOps and on success /p BinOp will contain the matching opcode.
1873  /// Returns the vector that is being reduced on, or SDValue() if a reduction
1874  /// was not matched. If \p AllowPartials is set then in the case of a
1875  /// reduction pattern that only matches the first few stages, the extracted
1876  /// subvector of the start of the reduction is returned.
1878  ArrayRef<ISD::NodeType> CandidateBinOps,
1879  bool AllowPartials = false);
1880 
1881  /// Utility function used by legalize and lowering to
1882  /// "unroll" a vector operation by splitting out the scalars and operating
1883  /// on each element individually. If the ResNE is 0, fully unroll the vector
1884  /// op. If ResNE is less than the width of the vector op, unroll up to ResNE.
1885  /// If the ResNE is greater than the width of the vector op, unroll the
1886  /// vector op and fill the end of the resulting vector with UNDEFS.
1887  SDValue UnrollVectorOp(SDNode *N, unsigned ResNE = 0);
1888 
1889  /// Like UnrollVectorOp(), but for the [US](ADD|SUB|MUL)O family of opcodes.
1890  /// This is a separate function because those opcodes have two results.
1891  std::pair<SDValue, SDValue> UnrollVectorOverflowOp(SDNode *N,
1892  unsigned ResNE = 0);
1893 
1894  /// Return true if loads are next to each other and can be
1895  /// merged. Check that both are nonvolatile and if LD is loading
1896  /// 'Bytes' bytes from a location that is 'Dist' units away from the
1897  /// location that the 'Base' load is loading from.
1899  unsigned Bytes, int Dist) const;
1900 
1901  /// Infer alignment of a load / store address. Return None if it cannot be
1902  /// inferred.
1903  MaybeAlign InferPtrAlign(SDValue Ptr) const;
1904 
1905  /// Compute the VTs needed for the low/hi parts of a type
1906  /// which is split (or expanded) into two not necessarily identical pieces.
1907  std::pair<EVT, EVT> GetSplitDestVTs(const EVT &VT) const;
1908 
1909  /// Compute the VTs needed for the low/hi parts of a type, dependent on an
1910  /// enveloping VT that has been split into two identical pieces. Sets the
1911  /// HisIsEmpty flag when hi type has zero storage size.
1912  std::pair<EVT, EVT> GetDependentSplitDestVTs(const EVT &VT, const EVT &EnvVT,
1913  bool *HiIsEmpty) const;
1914 
1915  /// Split the vector with EXTRACT_SUBVECTOR using the provides
1916  /// VTs and return the low/high part.
1917  std::pair<SDValue, SDValue> SplitVector(const SDValue &N, const SDLoc &DL,
1918  const EVT &LoVT, const EVT &HiVT);
1919 
1920  /// Split the vector with EXTRACT_SUBVECTOR and return the low/high part.
1921  std::pair<SDValue, SDValue> SplitVector(const SDValue &N, const SDLoc &DL) {
1922  EVT LoVT, HiVT;
1923  std::tie(LoVT, HiVT) = GetSplitDestVTs(N.getValueType());
1924  return SplitVector(N, DL, LoVT, HiVT);
1925  }
1926 
1927  /// Split the node's operand with EXTRACT_SUBVECTOR and
1928  /// return the low/high part.
1929  std::pair<SDValue, SDValue> SplitVectorOperand(const SDNode *N, unsigned OpNo)
1930  {
1931  return SplitVector(N->getOperand(OpNo), SDLoc(N));
1932  }
1933 
1934  /// Widen the vector up to the next power of two using INSERT_SUBVECTOR.
1935  SDValue WidenVector(const SDValue &N, const SDLoc &DL);
1936 
1937  /// Append the extracted elements from Start to Count out of the vector Op in
1938  /// Args. If Count is 0, all of the elements will be extracted. The extracted
1939  /// elements will have type EVT if it is provided, and otherwise their type
1940  /// will be Op's element type.
1942  unsigned Start = 0, unsigned Count = 0,
1943  EVT EltVT = EVT());
1944 
1945  /// Compute the default alignment value for the given type.
1946  Align getEVTAlign(EVT MemoryVT) const;
1947  /// Compute the default alignment value for the given type.
1948  /// FIXME: Remove once transition to Align is over.
1949  inline unsigned getEVTAlignment(EVT MemoryVT) const {
1950  return getEVTAlign(MemoryVT).value();
1951  }
1952 
1953  /// Test whether the given value is a constant int or similar node.
1955 
1956  /// Test whether the given value is a constant FP or similar node.
1958 
1959  /// \returns true if \p N is any kind of constant or build_vector of
1960  /// constants, int or float. If a vector, it may not necessarily be a splat.
1961  inline bool isConstantValueOfAnyType(SDValue N) const {
1964  }
1965 
1967  SDCallSiteDbgInfo[CallNode].CSInfo = std::move(CallInfo);
1968  }
1969 
1971  auto I = SDCallSiteDbgInfo.find(CallNode);
1972  if (I != SDCallSiteDbgInfo.end())
1973  return std::move(I->second).CSInfo;
1974  return CallSiteInfo();
1975  }
1976 
1977  void addHeapAllocSite(const SDNode *Node, MDNode *MD) {
1978  SDCallSiteDbgInfo[Node].HeapAllocSite = MD;
1979  }
1980 
1981  /// Return the HeapAllocSite type associated with the SDNode, if it exists.
1983  auto It = SDCallSiteDbgInfo.find(Node);
1984  if (It == SDCallSiteDbgInfo.end())
1985  return nullptr;
1986  return It->second.HeapAllocSite;
1987  }
1988 
1989  void addNoMergeSiteInfo(const SDNode *Node, bool NoMerge) {
1990  if (NoMerge)
1991  SDCallSiteDbgInfo[Node].NoMerge = NoMerge;
1992  }
1993 
1995  auto I = SDCallSiteDbgInfo.find(Node);
1996  if (I == SDCallSiteDbgInfo.end())
1997  return false;
1998  return I->second.NoMerge;
1999  }
2000 
2001  /// Return the current function's default denormal handling kind for the given
2002  /// floating point type.
2004  return MF->getDenormalMode(EVTToAPFloatSemantics(VT));
2005  }
2006 
2007  bool shouldOptForSize() const;
2008 
2009  /// Get the (commutative) neutral element for the given opcode, if it exists.
2010  SDValue getNeutralElement(unsigned Opcode, const SDLoc &DL, EVT VT,
2011  SDNodeFlags Flags);
2012 
2013 private:
2014  void InsertNode(SDNode *N);
2015  bool RemoveNodeFromCSEMaps(SDNode *N);
2016  void AddModifiedNodeToCSEMaps(SDNode *N);
2017  SDNode *FindModifiedNodeSlot(SDNode *N, SDValue Op, void *&InsertPos);
2018  SDNode *FindModifiedNodeSlot(SDNode *N, SDValue Op1, SDValue Op2,
2019  void *&InsertPos);
2020  SDNode *FindModifiedNodeSlot(SDNode *N, ArrayRef<SDValue> Ops,
2021  void *&InsertPos);
2022  SDNode *UpdateSDLocOnMergeSDNode(SDNode *N, const SDLoc &loc);
2023 
2024  void DeleteNodeNotInCSEMaps(SDNode *N);
2025  void DeallocateNode(SDNode *N);
2026 
2027  void allnodes_clear();
2028 
2029  /// Look up the node specified by ID in CSEMap. If it exists, return it. If
2030  /// not, return the insertion token that will make insertion faster. This
2031  /// overload is for nodes other than Constant or ConstantFP, use the other one
2032  /// for those.
2033  SDNode *FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos);
2034 
2035  /// Look up the node specified by ID in CSEMap. If it exists, return it. If
2036  /// not, return the insertion token that will make insertion faster. Performs
2037  /// additional processing for constant nodes.
2038  SDNode *FindNodeOrInsertPos(const FoldingSetNodeID &ID, const SDLoc &DL,
2039  void *&InsertPos);
2040 
2041  /// List of non-single value types.
2042  FoldingSet<SDVTListNode> VTListMap;
2043 
2044  /// Maps to auto-CSE operations.
2045  std::vector<CondCodeSDNode*> CondCodeNodes;
2046 
2047  std::vector<SDNode*> ValueTypeNodes;
2048  std::map<EVT, SDNode*, EVT::compareRawBits> ExtendedValueTypeNodes;
2049  StringMap<SDNode*> ExternalSymbols;
2050 
2051  std::map<std::pair<std::string, unsigned>, SDNode *> TargetExternalSymbols;
2053 
2054  FlagInserter *Inserter = nullptr;
2055 };
2056 
2057 template <> struct GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> {
2059 
2061  return nodes_iterator(G->allnodes_begin());
2062  }
2063 
2065  return nodes_iterator(G->allnodes_end());
2066  }
2067 };
2068 
2069 } // end namespace llvm
2070 
2071 #endif // LLVM_CODEGEN_SELECTIONDAG_H
removeOperands
static void removeOperands(MachineInstr &MI, unsigned i)
Definition: ThumbRegisterInfo.cpp:338
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::SelectionDAG::expandVACopy
SDValue expandVACopy(SDNode *Node)
Expand the specified ISD::VACOPY node as the Legalize pass would.
Definition: SelectionDAG.cpp:2139
llvm::SelectionDAG::getGLOBAL_OFFSET_TABLE
SDValue getGLOBAL_OFFSET_TABLE(EVT VT)
Return a GLOBAL_OFFSET_TABLE node. This does not have a useful SDLoc.
Definition: SelectionDAG.h:964
llvm::SelectionDAG::getConstantDbgValue
SDDbgValue * getConstantDbgValue(DIVariable *Var, DIExpression *Expr, const Value *C, const DebugLoc &DL, unsigned O)
Creates a constant SDDbgValue node.
Definition: SelectionDAG.cpp:8784
llvm::SelectionDAG::getTargetConstantFP
SDValue getTargetConstantFP(const ConstantFP &Val, const SDLoc &DL, EVT VT)
Definition: SelectionDAG.h:675
SDAG
QP Compare Ordered outs ins xscmpudp No SDAG
Definition: README_P9.txt:301
ValueTypes.h
llvm::SelectionDAG::transferDbgValues
void transferDbgValues(SDValue From, SDValue To, unsigned OffsetInBits=0, unsigned SizeInBits=0, bool InvalidateDbg=true)
Transfer debug values from one node to another, while optionally generating fragment expressions for ...
Definition: SelectionDAG.cpp:8846
llvm::SelectionDAG::getTargetConstantPool
SDValue getTargetConstantPool(MachineConstantPoolValue *C, EVT VT, MaybeAlign Align=None, int Offset=0, unsigned TargetFlags=0)
Definition: SelectionDAG.h:707
llvm::SDDbgValue
Holds the information from a dbg_value node through SDISel.
Definition: SDNodeDbgValue.h:132
llvm::ISD::STRICT_FSETCC
@ STRICT_FSETCC
STRICT_FSETCC/STRICT_FSETCCS - Constrained versions of SETCC, used for floating-point operands only.
Definition: ISDOpcodes.h:462
Attrs
Function Attrs
Definition: README_ALTIVEC.txt:215
llvm::SelectionDAG::getStore
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Definition: SelectionDAG.h:1262
llvm::SelectionDAG::GetDbgValues
ArrayRef< SDDbgValue * > GetDbgValues(const SDNode *SD) const
Get the debug values which reference the given SDNode.
Definition: SelectionDAG.h:1611
llvm::SelectionDAG::VerifyDAGDiverence
void VerifyDAGDiverence()
Definition: SelectionDAG.cpp:9309
llvm::SelectionDAG::getCALLSEQ_START
SDValue getCALLSEQ_START(SDValue Chain, uint64_t InSize, uint64_t OutSize, const SDLoc &DL)
Return a new CALLSEQ_START node, that starts new call frame, in which InSize bytes are set up inside ...
Definition: SelectionDAG.h:923
llvm::ISD::MemIndexedMode
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
Definition: ISDOpcodes.h:1304
llvm::SelectionDAG::GetDemandedBits
SDValue GetDemandedBits(SDValue V, const APInt &DemandedBits)
See if the specified operand can be simplified with the knowledge that only the bits specified by Dem...
Definition: SelectionDAG.cpp:2376
llvm::SelectionDAG::getEVTAlignment
unsigned getEVTAlignment(EVT MemoryVT) const
Compute the default alignment value for the given type.
Definition: SelectionDAG.h:1949
LLVM_DUMP_METHOD
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition: Compiler.h:491
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
Reg
unsigned Reg
Definition: MachineSink.cpp:1566
llvm::SelectionDAG::AssignTopologicalOrder
unsigned AssignTopologicalOrder()
Topological-sort the AllNodes list and a assign a unique node id for each node in the DAG based on th...
Definition: SelectionDAG.cpp:9382
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::SelectionDAG::getValidMaximumShiftAmountConstant
const APInt * getValidMaximumShiftAmountConstant(SDValue V, const APInt &DemandedElts) const
If a SHL/SRA/SRL node V has constant shift amounts that are all less than the element bit-width of th...
Definition: SelectionDAG.cpp:2700
llvm::SelectionDAG::getSelectionDAGInfo
const SelectionDAGTargetInfo & getSelectionDAGInfo() const
Definition: SelectionDAG.h:445
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::SelectionDAG::isGuaranteedNotToBePoison
bool isGuaranteedNotToBePoison(SDValue Op, const APInt &DemandedElts, unsigned Depth=0) const
Return true if this function can prove that Op is never poison.
Definition: SelectionDAG.h:1791
llvm::SDLoc
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Definition: SelectionDAGNodes.h:1078
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:112
llvm::SelectionDAG::isKnownNeverZero
bool isKnownNeverZero(SDValue Op) const
Test whether the given SDValue is known to contain non-zero value(s).
Definition: SelectionDAG.cpp:4457
llvm::SelectionDAG::setSubgraphColor
void setSubgraphColor(SDNode *N, const char *Color)
Convenience for setting subgraph color attribute.
Definition: SelectionDAGPrinter.cpp:269
llvm::SelectionDAG::setGraphColor
void setGraphColor(const SDNode *N, const char *Color)
Convenience for setting node color attribute.
Definition: SelectionDAGPrinter.cpp:225
llvm::SelectionDAG::GetDependentSplitDestVTs
std::pair< EVT, EVT > GetDependentSplitDestVTs(const EVT &VT, const EVT &EnvVT, bool *HiIsEmpty) const
Compute the VTs needed for the low/hi parts of a type, dependent on an enveloping VT that has been sp...
Definition: SelectionDAG.cpp:10211
Metadata.h
llvm::SelectionDAG::SignBitIsZero
bool SignBitIsZero(SDValue Op, unsigned Depth=0) const
Return true if the sign bit of Op is known to be zero.
Definition: SelectionDAG.cpp:2430
llvm::SelectionDAG::getSplatVector
SDValue getSplatVector(EVT VT, const SDLoc &DL, SDValue Op)
Definition: SelectionDAG.h:824
llvm::SelectionDAG::addNoMergeSiteInfo
void addNoMergeSiteInfo(const SDNode *Node, bool NoMerge)
Definition: SelectionDAG.h:1989
AtomicOrdering.h
llvm::APFloatBase::IEEEsingle
static const fltSemantics & IEEEsingle() LLVM_READNONE
Definition: APFloat.cpp:170
llvm::SelectionDAG::DAGUpdateListener::NodeDeleted
virtual void NodeDeleted(SDNode *N, SDNode *E)
The node N that was deleted and, if E is not null, an equivalent node E that replaced it.
Definition: SelectionDAG.cpp:92
llvm::SelectionDAG::getCopyToReg
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N)
Definition: SelectionDAG.h:735
llvm::MVT::ppcf128
@ ppcf128
Definition: MachineValueType.h:59
llvm::SDValue::getNode
SDNode * getNode() const
get the SDNode which holds the desired result
Definition: SelectionDAGNodes.h:152
llvm::Function
Definition: Function.h:61
llvm::ISD::ConstantFP
@ ConstantFP
Definition: ISDOpcodes.h:77
llvm::SelectionDAG::allnodes_end
allnodes_const_iterator allnodes_end() const
Definition: SelectionDAG.h:494
llvm::SDDbgInfo
Keeps track of dbg_value information through SDISel.
Definition: SelectionDAG.h:150
llvm::SelectionDAG::getValueType
SDValue getValueType(EVT)
Definition: SelectionDAG.cpp:1697
llvm::ARM_MB::LD
@ LD
Definition: ARMBaseInfo.h:72
llvm::SelectionDAG::setGraphAttrs
void setGraphAttrs(const SDNode *N, const char *Attrs)
Set graph attributes for a node. (eg. "color=red".)
Definition: SelectionDAGPrinter.cpp:195
llvm::APInt::getMinSignedBits
unsigned getMinSignedBits() const
Get the minimum bit size for this signed APInt.
Definition: APInt.h:1624
llvm::SelectionDAG::getExtLoad
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
FIXME: Remove once transition to Align is over.
Definition: SelectionDAG.h:1206
llvm::SDDbgInfo::SDDbgInfo
SDDbgInfo()=default
llvm::SelectionDAG::FlagInserter
Help to insert SDNodeFlags automatically in transforming.
Definition: SelectionDAG.h:329
llvm::SelectionDAG::getTargetConstantFP
SDValue getTargetConstantFP(const APFloat &Val, const SDLoc &DL, EVT VT)
Definition: SelectionDAG.h:672
llvm::SelectionDAG::getFrameIndex
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
Definition: SelectionDAG.cpp:1578
llvm::SDDbgInfo::DbgLabelIterator
SmallVectorImpl< SDDbgLabel * >::iterator DbgLabelIterator
Definition: SelectionDAG.h:193
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
ilist.h
llvm::SelectionDAG::init
void init(MachineFunction &NewMF, OptimizationRemarkEmitter &NewORE, Pass *PassPtr, const TargetLibraryInfo *LibraryInfo, LegacyDivergenceAnalysis *Divergence, ProfileSummaryInfo *PSIin, BlockFrequencyInfo *BFIin)
Prepare this SelectionDAG to process code in the given MachineFunction.
Definition: SelectionDAG.cpp:1141
llvm::SelectionDAG::allnodes_begin
allnodes_iterator allnodes_begin()
Definition: SelectionDAG.h:498
llvm::SelectionDAG::getVTList
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
Definition: SelectionDAG.cpp:8157
llvm::MachineSDNode
An SDNode that represents everything that will be needed to construct a MachineInstr.
Definition: SelectionDAGNodes.h:2530
llvm::SelectionDAG::FoldSetCC
SDValue FoldSetCC(EVT VT, SDValue N1, SDValue N2, ISD::CondCode Cond, const SDLoc &dl)
Constant fold a setcc to true or false.
Definition: SelectionDAG.cpp:2217
llvm::SDDbgInfo::operator=
SDDbgInfo & operator=(const SDDbgInfo &)=delete
ErrorHandling.h
llvm::SelectionDAG::allnodes_begin
allnodes_const_iterator allnodes_begin() const
Definition: SelectionDAG.h:493
llvm::SelectionDAG::getRoot
const SDValue & getRoot() const
Return the root tag of the SelectionDAG.
Definition: SelectionDAG.h:513
llvm::SelectionDAG::setFlagInserter
void setFlagInserter(FlagInserter *FI)
Definition: SelectionDAG.h:453
llvm::SelectionDAG::getVectorIdxConstant
SDValue getVectorIdxConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
Definition: SelectionDAG.cpp:1483
Allocator.h
llvm::ISD::MemIndexType
MemIndexType
MemIndexType enum - This enum defines how to interpret MGATHER/SCATTER's index parameter when calcula...
Definition: ISDOpcodes.h:1316
llvm::SelectionDAG::getNoMergeSiteInfo
bool getNoMergeSiteInfo(const SDNode *Node)
Definition: SelectionDAG.h:1994
llvm::SelectionDAG::getMemmove
SDValue getMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, Align Alignment, bool isVol, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo, const AAMDNodes &AAInfo=AAMDNodes())
Definition: SelectionDAG.cpp:6926
llvm::SDNode
Represents one node in the SelectionDAG.
Definition: SelectionDAGNodes.h:455
llvm::SelectionDAG::hasDebugValues
bool hasDebugValues() const
Return true if there are any SDDbgValue nodes associated with this SelectionDAG.
Definition: SelectionDAG.h:1618
llvm::SelectionDAG::ReplaceAllUsesWith
void ReplaceAllUsesWith(SDValue From, SDValue To)
Modify anything using 'From' to use 'To' instead.
Definition: SelectionDAG.cpp:9029
llvm::APFloatBase::x87DoubleExtended
static const fltSemantics & x87DoubleExtended() LLVM_READNONE
Definition: APFloat.cpp:179
llvm::LoadSDNode
This class is used to represent ISD::LOAD nodes.
Definition: SelectionDAGNodes.h:2263
llvm::SelectionDAG::EVTToAPFloatSemantics
static const fltSemantics & EVTToAPFloatSemantics(EVT VT)
Returns an APFloat semantics tag appropriate for the given type.
Definition: SelectionDAG.h:1590
llvm::SelectionDAG::getSplatSourceVector
SDValue getSplatSourceVector(SDValue V, int &SplatIndex)
If V is a splatted value, return the source vector and its splat index.
Definition: SelectionDAG.cpp:2584
llvm::MVT::Glue
@ Glue
Definition: MachineValueType.h:262
llvm::SelectionDAG::getMemBasePlusOffset
SDValue getMemBasePlusOffset(SDValue Base, TypeSize Offset, const SDLoc &DL, const SDNodeFlags Flags=SDNodeFlags())
Returns sum of the base pointer and offset.
Definition: SelectionDAG.cpp:6324
APInt.h
llvm::ArrayRecycler::Capacity::get
static Capacity get(size_t N)
Get the capacity of an array that can hold at least N elements.
Definition: ArrayRecycler.h:79
llvm::MachineConstantPoolValue
Abstract base class for all machine specific constantpool value subclasses.
Definition: MachineConstantPool.h:35
llvm::Depth
@ Depth
Definition: SIMachineScheduler.h:34
llvm::SelectionDAG::getLoad
SDValue getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue Offset, MachinePointerInfo PtrInfo, EVT MemVT, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Definition: SelectionDAG.h:1225
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::SelectionDAG::getCopyToReg
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, SDValue Reg, SDValue N, SDValue Glue)
Definition: SelectionDAG.h:753
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
DenseMap.h
llvm::APFloatBase::BFloat
static const fltSemantics & BFloat() LLVM_READNONE
Definition: APFloat.cpp:167
llvm::SelectionDAG::getZeroExtendInReg
SDValue getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT)
Return the expression required to zero extend the Op value assuming it was the smaller SrcTy value.
Definition: SelectionDAG.cpp:1290
llvm::MachineMemOperand
A description of a memory reference used in the backend.
Definition: MachineMemOperand.h:128
llvm::SelectionDAG::getSymbolFunctionGlobalAddress
SDValue getSymbolFunctionGlobalAddress(SDValue Op, Function **TargetFunction=nullptr)
Returs an GlobalAddress of the function from the current module with name matching the given External...
Definition: SelectionDAG.cpp:9507
llvm::SelectionDAG::getStore
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, Align Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
Definition: SelectionDAG.cpp:7486
llvm::SelectionDAG::getPtrExtOrTrunc
SDValue getPtrExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either truncating it or perform...
Definition: SelectionDAG.cpp:1308
llvm::SelectionDAG::ExtractVectorElements
void ExtractVectorElements(SDValue Op, SmallVectorImpl< SDValue > &Args, unsigned Start=0, unsigned Count=0, EVT EltVT=EVT())
Append the extracted elements from Start to Count out of the vector Op in Args.
Definition: SelectionDAG.cpp:10271
llvm::SDDbgInfo::DbgBegin
DbgIterator DbgBegin()
Definition: SelectionDAG.h:195
llvm::SelectionDAG::getValidMinimumShiftAmountConstant
const APInt * getValidMinimumShiftAmountConstant(SDValue V, const APInt &DemandedElts) const
If a SHL/SRA/SRL node V has constant shift amounts that are all less than the element bit-width of th...
Definition: SelectionDAG.cpp:2671
llvm::SelectionDAG::isBaseWithConstantOffset
bool isBaseWithConstantOffset(SDValue Op) const
Return true if the specified operand is an ISD::ADD with a ConstantSDNode on the right-hand side,...
Definition: SelectionDAG.cpp:4316
llvm::LargestSDNode
AlignedCharArrayUnion< AtomicSDNode, TargetIndexSDNode, BlockAddressSDNode, GlobalAddressSDNode, PseudoProbeSDNode > LargestSDNode
A representation of the largest SDNode, for use in sizeof().
Definition: SelectionDAGNodes.h:2670
llvm::ISD::SETCC
@ SETCC
SetCC operator - This evaluates to a true value iff the condition is true.
Definition: ISDOpcodes.h:702
llvm::ISD::CALLSEQ_START
@ CALLSEQ_START
CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end of a call sequence,...
Definition: ISDOpcodes.h:1026
llvm::SelectionDAG::addCallSiteInfo
void addCallSiteInfo(const SDNode *CallNode, CallSiteInfoImpl &&CallInfo)
Definition: SelectionDAG.h:1966
llvm::SelectionDAG::getSplatBuildVector
SDValue getSplatBuildVector(EVT VT, const SDLoc &DL, SDValue Op)
Return a splat ISD::BUILD_VECTOR node, consisting of Op splatted to all elements.
Definition: SelectionDAG.h:807
llvm::SelectionDAG::simplifySelect
SDValue simplifySelect(SDValue Cond, SDValue TVal, SDValue FVal)
Try to simplify a select/vselect into 1 of its operands or a constant.
Definition: SelectionDAG.cpp:7817
llvm::SelectionDAG::getFPExtendOrRound
SDValue getFPExtendOrRound(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of float type, to the float type VT, by either extending or rounding (by tr...
Definition: SelectionDAG.cpp:1243
llvm::BumpPtrAllocator
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition: Allocator.h:369
llvm::SelectionDAG::getCopyToReg
SDValue getCopyToReg(SDValue Chain, const SDLoc &dl, unsigned Reg, SDValue N, SDValue Glue)
Definition: SelectionDAG.h:744
llvm::SelectionDAG::doesNodeExist
bool doesNodeExist(unsigned Opcode, SDVTList VTList, ArrayRef< SDValue > Ops)
Check if a node exists without modifying its flags.
Definition: SelectionDAG.cpp:8757
llvm::SelectionDAG::getNodeIfExists
SDNode * getNodeIfExists(unsigned Opcode, SDVTList VTList, ArrayRef< SDValue > Ops, const SDNodeFlags Flags)
Get the specified node if it's already available, or else return NULL.
Definition: SelectionDAG.cpp:8741
llvm::SelectionDAG::isSplatValue
bool isSplatValue(SDValue V, const APInt &DemandedElts, APInt &UndefElts, unsigned Depth=0)
Test whether V has a splatted value for all the demanded elements.
Definition: SelectionDAG.cpp:2462
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::SelectionDAG::getEHLabel
SDValue getEHLabel(const SDLoc &dl, SDValue Root, MCSymbol *Label)
Definition: SelectionDAG.cpp:1989
llvm::iplist_impl< simple_ilist< T, Options... >, ilist_traits< T > >::remove
pointer remove(iterator &IT)
Definition: ilist.h:251
llvm::SelectionDAG::getCommutedVectorShuffle
SDValue getCommutedVectorShuffle(const ShuffleVectorSDNode &SV)
Returns an ISD::VECTOR_SHUFFLE node semantically equivalent to the shuffle node in input but with swa...
Definition: SelectionDAG.cpp:1950
llvm::SelectionDAG::getTruncStore
SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT SVT, unsigned Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
FIXME: Remove once transition to Align is over.
Definition: SelectionDAG.h:1298
llvm::SelectionDAG::RemoveDeadNodes
void RemoveDeadNodes()
This method deletes all unreachable nodes in the SelectionDAG.
Definition: SelectionDAG.cpp:802
llvm::DIExpression
DWARF expression.
Definition: DebugInfoMetadata.h:2557
llvm::SelectionDAG::getZExtOrTrunc
SDValue getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either zero-extending or trunca...
Definition: SelectionDAG.cpp:1275
llvm::SDDbgInfo::getAlloc
BumpPtrAllocator & getAlloc()
Definition: SelectionDAG.h:179
llvm::EVT::bitsLE
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
Definition: ValueTypes.h:281
llvm::SelectionDAG::isConstantIntBuildVectorOrConstantInt
SDNode * isConstantIntBuildVectorOrConstantInt(SDValue N) const
Test whether the given value is a constant int or similar node.
Definition: SelectionDAG.cpp:10528
llvm::SelectionDAG::getStrictFPExtendOrRound
std::pair< SDValue, SDValue > getStrictFPExtendOrRound(SDValue Op, SDValue Chain, const SDLoc &DL, EVT VT)
Convert Op, which must be a STRICT operation of float type, to the float type VT, by either extending...
Definition: SelectionDAG.cpp:1250
llvm::SelectionDAG::~SelectionDAG
~SelectionDAG()
Definition: SelectionDAG.cpp:1159
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::SelectionDAG::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
Definition: SelectionDAG.h:442
llvm::SelectionDAG::clear
void clear()
Clear state and free memory necessary to make this SelectionDAG ready to process a new block.
Definition: SelectionDAG.cpp:1221
llvm::SelectionDAG::getDbgLabel
SDDbgLabel * getDbgLabel(DILabel *Label, const DebugLoc &DL, unsigned O)
Creates a SDDbgLabel node.
Definition: SelectionDAG.cpp:8992
llvm::SelectionDAG::DAGUpdateListener::DAGUpdateListener
DAGUpdateListener(SelectionDAG &D)
Definition: SelectionDAG.h:292
llvm::ISD::CALLSEQ_END
@ CALLSEQ_END
Definition: ISDOpcodes.h:1027
llvm::iplist
An intrusive list with ownership and callbacks specified/controlled by ilist_traits,...
Definition: ilist.h:390
llvm::SelectionDAG::getIndexedStore
SDValue getIndexedStore(SDValue OrigStore, const SDLoc &dl, SDValue Base, SDValue Offset, ISD::MemIndexedMode AM)
Definition: SelectionDAG.cpp:7603
llvm::SDDbgInfo::ByvalParmDbgBegin
DbgIterator ByvalParmDbgBegin()
Definition: SelectionDAG.h:197
llvm::SDVTListNode::getSDVTList
SDVTList getSDVTList()
Definition: SelectionDAG.h:108
llvm::SelectionDAG::ReplaceAllUsesOfValuesWith
void ReplaceAllUsesOfValuesWith(const SDValue *From, const SDValue *To, unsigned Num)
Like ReplaceAllUsesOfValueWith, but for multiple values at once.
Definition: SelectionDAG.cpp:9323
llvm::FoldingSetTrait< SDVTListNode >::ComputeHash
static unsigned ComputeHash(const SDVTListNode &X, FoldingSetNodeID &TempID)
Definition: SelectionDAG.h:128
llvm::SelectionDAG::getContext
LLVMContext * getContext() const
Definition: SelectionDAG.h:447
size_t
llvm::SelectionDAG::DbgBegin
SDDbgInfo::DbgIterator DbgBegin() const
Definition: SelectionDAG.h:1620
llvm::SelectionDAG::isKnownNeverSNaN
bool isKnownNeverSNaN(SDValue Op, unsigned Depth=0) const
Definition: SelectionDAG.h:1810
llvm::SelectionDAG::FoldConstantVectorArithmetic
SDValue FoldConstantVectorArithmetic(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDValue > Ops, const SDNodeFlags Flags=SDNodeFlags())
Definition: SelectionDAG.cpp:5349
llvm::RISCVFenceField::R
@ R
Definition: RISCVBaseInfo.h:180
llvm::ShuffleVectorSDNode
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
Definition: SelectionDAGNodes.h:1484
llvm::SelectionDAG::getRegister
SDValue getRegister(unsigned Reg, EVT VT)
Definition: SelectionDAG.cpp:1960
llvm::APFloatBase::IEEEquad
static const fltSemantics & IEEEquad() LLVM_READNONE
Definition: APFloat.cpp:176
MachineValueType.h
result
It looks like we only need to define PPCfmarto for these because according to these instructions perform RTO on fma s result
Definition: README_P9.txt:256
llvm::SelectionDAG::FlagInserter::~FlagInserter
~FlagInserter()
Definition: SelectionDAG.h:345
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::SelectionDAG::getVRegDbgValue
SDDbgValue * getVRegDbgValue(DIVariable *Var, DIExpression *Expr, unsigned VReg, bool IsIndirect, const DebugLoc &DL, unsigned O)
Creates a VReg SDDbgValue node.
Definition: SelectionDAG.cpp:8823
llvm::SelectionDAG::foldConstantFPMath
SDValue foldConstantFPMath(unsigned Opcode, const SDLoc &DL, EVT VT, SDValue N1, SDValue N2)
Fold floating-point operations with 2 operands when both operands are constants and/or undefined.
Definition: SelectionDAG.cpp:5455
llvm::CallInfo
Definition: GVNHoist.cpp:217
llvm::ISD::LoadExtType
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
Definition: ISDOpcodes.h:1335
llvm::SelectionDAG::getVScale
SDValue getVScale(const SDLoc &DL, EVT VT, APInt MulImm)
Return a node that represents the runtime scaling 'MulImm * RuntimeVL'.
Definition: SelectionDAG.h:956
llvm::ConstantInt
This is the shared class of boolean and integer constants.
Definition: Constants.h:79
llvm::SelectionDAG::getLoad
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands,...
Definition: SelectionDAG.cpp:7436
llvm::SelectionDAG::getDbgValue
SDDbgValue * getDbgValue(DIVariable *Var, DIExpression *Expr, SDNode *N, unsigned R, bool IsIndirect, const DebugLoc &DL, unsigned O)
Creates a SDDbgValue node.
Definition: SelectionDAG.cpp:8772
llvm::BlockFrequencyInfo
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
Definition: BlockFrequencyInfo.h:37
llvm::SelectionDAG::DAGNodeDeletedListener::DAGNodeDeletedListener
DAGNodeDeletedListener(SelectionDAG &DAG, std::function< void(SDNode *, SDNode *)> Callback)
Definition: SelectionDAG.h:317
llvm::SelectionDAG::getMaskedStore
SDValue getMaskedStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Base, SDValue Offset, SDValue Mask, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexedMode AM, bool IsTruncating=false, bool IsCompressing=false)
Definition: SelectionDAG.cpp:7676
llvm::SelectionDAG::isGuaranteedNotToBeUndefOrPoison
bool isGuaranteedNotToBeUndefOrPoison(SDValue Op, bool PoisonOnly=false, unsigned Depth=0) const
Return true if this function can prove that Op is never poison and, if PoisonOnly is false,...
Definition: SelectionDAG.cpp:4251
llvm::ISD::SELECT_CC
@ SELECT_CC
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
Definition: ISDOpcodes.h:694
llvm::SelectionDAG::getIndexedMaskedLoad
SDValue getIndexedMaskedLoad(SDValue OrigLoad, const SDLoc &dl, SDValue Base, SDValue Offset, ISD::MemIndexedMode AM)
Definition: SelectionDAG.cpp:7665
llvm::SelectionDAG::getTargetFrameIndex
SDValue getTargetFrameIndex(int FI, EVT VT)
Definition: SelectionDAG.h:688
llvm::SelectionDAG::DAGUpdateListener::DAG
SelectionDAG & DAG
Definition: SelectionDAG.h:290
llvm::SDValue::getValueType
EVT getValueType() const
Return the ValueType of the referenced return value.
Definition: SelectionDAGNodes.h:1113
llvm::SelectionDAG::isKnownToBeAPowerOfTwo
bool isKnownToBeAPowerOfTwo(SDValue Val) const
Test if the given value is known to have exactly one bit set.
Definition: SelectionDAG.cpp:3617
llvm::SDDbgLabel
Holds the information from a dbg_label node through SDISel.
Definition: SDNodeDbgValue.h:241
llvm::SelectionDAG::matchBinOpReduction
SDValue matchBinOpReduction(SDNode *Extract, ISD::NodeType &BinOp, ArrayRef< ISD::NodeType > CandidateBinOps, bool AllowPartials=false)
Match a binop + shuffle pyramid that represents a horizontal reduction over the elements of a vector ...
Definition: SelectionDAG.cpp:9898
llvm::SelectionDAG::DAGUpdateListener::~DAGUpdateListener
virtual ~DAGUpdateListener()
Definition: SelectionDAG.h:297
llvm::SelectionDAG::getTargetConstant
SDValue getTargetConstant(const ConstantInt &Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
Definition: SelectionDAG.h:645
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
SelectionDAGNodes.h
llvm::ISD::SELECT
@ SELECT
Select(COND, TRUEVAL, FALSEVAL).
Definition: ISDOpcodes.h:679
llvm::SelectionDAG::UpdateNodeOperands
SDNode * UpdateNodeOperands(SDNode *N, SDValue Op)
Mutate the specified node in-place to have the specified operands.
Definition: SelectionDAG.cpp:8247
llvm::ISD::Constant
@ Constant
Definition: ISDOpcodes.h:76
llvm::SelectionDAG::getAtomicMemset
SDValue getAtomicMemset(SDValue Chain, const SDLoc &dl, SDValue Dst, unsigned DstAlign, SDValue Value, SDValue Size, Type *SizeTy, unsigned ElemSz, bool isTailCall, MachinePointerInfo DstPtrInfo)
Definition: SelectionDAG.cpp:7089
llvm::SelectionDAG::getBoolExtOrTrunc
SDValue getBoolExtOrTrunc(SDValue Op, const SDLoc &SL, EVT VT, EVT OpVT)
Convert Op, which must be of integer type, to the integer type VT, by using an extension appropriate ...
Definition: SelectionDAG.cpp:1281
llvm::AAResults
Definition: AliasAnalysis.h:456
llvm::SelectionDAG::getTargetBlockAddress
SDValue getTargetBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, unsigned TargetFlags=0)
Definition: SelectionDAG.h:730
llvm::SelectionDAG::getTruncStore
SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT SVT, Align Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Definition: SelectionDAG.cpp:7537
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::APFloatBase::IEEEhalf
static const fltSemantics & IEEEhalf() LLVM_READNONE
Definition: APFloat.cpp:164
llvm::SelectionDAG::LegalizeTypes
bool LegalizeTypes()
This transforms the SelectionDAG into a SelectionDAG that only uses types natively supported by the t...
Definition: LegalizeTypes.cpp:1055
llvm::SelectionDAG::getObjectPtrOffset
SDValue getObjectPtrOffset(const SDLoc &SL, SDValue Ptr, TypeSize Offset)
Create an add instruction with appropriate flags when used for addressing some offset of an object.
Definition: SelectionDAG.h:906
llvm::SelectionDAG::getVAArg
SDValue getVAArg(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue SV, unsigned Align)
VAArg produces a result and token chain, and takes a pointer and a source value as input.
Definition: SelectionDAG.cpp:7916
llvm::SelectionDAG::getUNDEF
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
Definition: SelectionDAG.h:951
llvm::ISD::CopyToReg
@ CopyToReg
CopyToReg - This node has three operands: a chain, a register number to set to this value,...
Definition: ISDOpcodes.h:203
llvm::SelectionDAG::FlagInserter::FlagInserter
FlagInserter(SelectionDAG &SDAG, SDNode *N)
Definition: SelectionDAG.h:340
llvm::SelectionDAG::getTargetLoweringInfo
const TargetLowering & getTargetLoweringInfo() const
Definition: SelectionDAG.h:443
llvm::EVT
Extended Value Type.
Definition: ValueTypes.h:35
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::SelectionDAG::getSrcValue
SDValue getSrcValue(const Value *v)
Construct a node to track a Value* through the backend.
Definition: SelectionDAG.cpp:2033
llvm::MachineFunction::getDenormalMode
DenormalMode getDenormalMode(const fltSemantics &FPType) const
Returns the denormal handling type for the default rounding mode of the function.
Definition: MachineFunction.cpp:275
llvm::MVT::f64
@ f64
Definition: MachineValueType.h:56
llvm::SelectionDAG::getConstant
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
Definition: SelectionDAG.cpp:1348
llvm::EVT::getVectorNumElements
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
Definition: ValueTypes.h:309
llvm::TargetLowering
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Definition: TargetLowering.h:3170
llvm::SelectionDAG::isUndef
bool isUndef(unsigned Opcode, ArrayRef< SDValue > Ops)
Return true if the result of this operation is always undefined.
Definition: SelectionDAG.cpp:5183
llvm::SelectionDAG::allnodes
iterator_range< allnodes_const_iterator > allnodes() const
Definition: SelectionDAG.h:508
Y
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
llvm::SelectionDAG::MaskedValueIsZero
bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth=0) const
Return true if 'Op & Mask' is known to be zero.
Definition: SelectionDAG.cpp:2438
llvm::SelectionDAG::getFlagInserter
FlagInserter * getFlagInserter()
Definition: SelectionDAG.h:452
llvm::SelectionDAG::FlagInserter::getFlags
SDNodeFlags getFlags() const
Definition: SelectionDAG.h:347
llvm::SelectionDAG::getDivergenceAnalysis
const LegacyDivergenceAnalysis * getDivergenceAnalysis() const
Definition: SelectionDAG.h:446
llvm::SelectionDAG::DAGUpdateListener::NodeInserted
virtual void NodeInserted(SDNode *N)
The node N that was inserted.
Definition: SelectionDAG.cpp:94
llvm::SelectionDAG::Legalize
void Legalize()
This transforms the SelectionDAG into a SelectionDAG that is compatible with the target instruction s...
Definition: LegalizeDAG.cpp:4933
llvm::SelectionDAG::simplifyFPBinop
SDValue simplifyFPBinop(unsigned Opcode, SDValue X, SDValue Y, SDNodeFlags Flags)
Try to simplify a floating-point binary operation into 1 of its operands or a constant.
Definition: SelectionDAG.cpp:7871
llvm::SelectionDAG::InferPtrAlign
MaybeAlign InferPtrAlign(SDValue Ptr) const
Infer alignment of a load / store address.
Definition: SelectionDAG.cpp:10160
llvm::MVT::SimpleTy
SimpleValueType SimpleTy
Definition: MachineValueType.h:321
llvm::SelectionDAG::DAGUpdateListener::NodeUpdated
virtual void NodeUpdated(SDNode *N)
The node N that was updated.
Definition: SelectionDAG.cpp:93
llvm::SelectionDAG::getFreeze
SDValue getFreeze(SDValue V)
Return a freeze using the SDLoc of the value operand.
Definition: SelectionDAG.cpp:2091
DAGCombine.h
llvm::ArrayRecycler::deallocate
void deallocate(Capacity Cap, T *Ptr)
Deallocate an array with the specified Capacity.
Definition: ArrayRecycler.h:137
llvm::SelectionDAGTargetInfo
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
Definition: SelectionDAGTargetInfo.h:31
DenseSet.h
llvm::ISD::GLOBAL_OFFSET_TABLE
@ GLOBAL_OFFSET_TABLE
The address of the GOT.
Definition: ISDOpcodes.h:87
llvm::SelectionDAG::DbgLabelBegin
SDDbgInfo::DbgLabelIterator DbgLabelBegin() const
Definition: SelectionDAG.h:1630
llvm::SDDbgInfo::empty
bool empty() const
Definition: SelectionDAG.h:181
llvm::MaybeAlign
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Definition: Alignment.h:109
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::ISD::NodeType
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
Definition: ISDOpcodes.h:40
llvm::SelectionDAG::setRoot
const SDValue & setRoot(SDValue N)
Set the current root tag of the SelectionDAG.
Definition: SelectionDAG.h:522
llvm::SelectionDAG::FlagInserter::FlagInserter
FlagInserter(SelectionDAG &SDAG, SDNodeFlags Flags)
Definition: SelectionDAG.h:335
llvm::EVT::isInteger
bool isInteger() const
Return true if this is an integer or a vector integer type.
Definition: ValueTypes.h:145
llvm::SelectionDAG::getMemIntrinsicNode
SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, MaybeAlign Alignment=None, MachineMemOperand::Flags Flags=MachineMemOperand::MOLoad|MachineMemOperand::MOStore, uint64_t Size=0, const AAMDNodes &AAInfo=AAMDNodes())
Definition: SelectionDAG.h:1144
llvm::SDVTListNode
Definition: SelectionDAG.h:87
llvm::SelectionDAG::DAGNodeDeletedListener
Definition: SelectionDAG.h:314
llvm::SelectionDAG::getAddrSpaceCast
SDValue getAddrSpaceCast(const SDLoc &dl, EVT VT, SDValue Ptr, unsigned SrcAS, unsigned DestAS)
Return an AddrSpaceCastSDNode.
Definition: SelectionDAG.cpp:2070
llvm::ConstantFP
ConstantFP - Floating Point Values [float, double].
Definition: Constants.h:257
APFloat.h
This file declares a class to represent arbitrary precision floating point values and provide a varie...
llvm::SelectionDAG::isEqualTo
bool isEqualTo(SDValue A, SDValue B) const
Test whether two SDValues are known to compare equal.
Definition: SelectionDAG.cpp:4479
llvm::SelectionDAG::getMemIntrinsicNode
SDValue getMemIntrinsicNode(unsigned Opcode, const SDLoc &dl, SDVTList VTList, ArrayRef< SDValue > Ops, EVT MemVT, MachinePointerInfo PtrInfo, Align Alignment, MachineMemOperand::Flags Flags=MachineMemOperand::MOLoad|MachineMemOperand::MOStore, uint64_t Size=0, const AAMDNodes &AAInfo=AAMDNodes())
Creates a MemIntrinsicNode that may produce a result and takes a list of operands.
Definition: SelectionDAG.cpp:7213
llvm::LegacyDivergenceAnalysis
Definition: LegacyDivergenceAnalysis.h:31
llvm::SelectionDAG::dump
void dump() const
Definition: SelectionDAGDumper.cpp:913
DebugLoc.h
llvm::ISD::SETCC_INVALID
@ SETCC_INVALID
Definition: ISDOpcodes.h:1383
llvm::SelectionDAG::SplitVectorOperand
std::pair< SDValue, SDValue > SplitVectorOperand(const SDNode *N, unsigned OpNo)
Split the node's operand with EXTRACT_SUBVECTOR and return the low/high part.
Definition: SelectionDAG.h:1929
llvm::SelectionDAG::getAssertAlign
SDValue getAssertAlign(const SDLoc &DL, SDValue V, Align A)
Return an AssertAlignSDNode.
Definition: SelectionDAG.cpp:5518
StringMap.h
llvm::ISD::SPLAT_VECTOR
@ SPLAT_VECTOR
SPLAT_VECTOR(VAL) - Returns a vector with the scalar value VAL duplicated in all lanes.
Definition: ISDOpcodes.h:590
llvm::SelectionDAG::isKnownNeverNaN
bool isKnownNeverNaN(SDValue Op, bool SNaN=false, unsigned Depth=0) const
Test whether the given SDValue is known to never be NaN.
Definition: SelectionDAG.cpp:4328
llvm::SDDbgInfo::DbgLabelBegin
DbgLabelIterator DbgLabelBegin()
Definition: SelectionDAG.h:199
llvm::SelectionDAG::viewGraph
void viewGraph()
Definition: SelectionDAGPrinter.cpp:163
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
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
llvm::ISD::CopyFromReg
@ CopyFromReg
CopyFromReg - This node indicates that the input value is a virtual or physical register that is defi...
Definition: ISDOpcodes.h:208
llvm::None
const NoneType None
Definition: None.h:23
llvm::SelectionDAG::getEVTAlign
Align getEVTAlign(EVT MemoryVT) const
Compute the default alignment value for the given type.
Definition: SelectionDAG.cpp:1124
llvm::SelectionDAG::getObjectPtrOffset
SDValue getObjectPtrOffset(const SDLoc &SL, SDValue Ptr, SDValue Offset)
Definition: SelectionDAG.h:912
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
llvm::M68kBeads::DA
@ DA
Definition: M68kBaseInfo.h:59
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:108
llvm::SelectionDAG::getTargetGlobalAddress
SDValue getTargetGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, unsigned TargetFlags=0)
Definition: SelectionDAG.h:683
llvm::SelectionDAG::expandVAArg
SDValue expandVAArg(SDNode *Node)
Expand the specified ISD::VAARG node as the Legalize pass would.
Definition: SelectionDAG.cpp:2105
llvm::ProfileSummaryInfo
Analysis providing profile information.
Definition: ProfileSummaryInfo.h:39
llvm::SelectionDAG::NodeGraphAttrs
std::map< const SDNode *, std::string > NodeGraphAttrs
Definition: SelectionDAG.h:471
llvm::SelectionDAG::SelectionDAG
SelectionDAG(const TargetMachine &TM, CodeGenOpt::Level)
Definition: SelectionDAG.cpp:1133
llvm::MVT::f80
@ f80
Definition: MachineValueType.h:57
llvm::GraphTraits< SDNode * >
Definition: SelectionDAGNodes.h:2648
llvm::SelectionDAG::getSDCallSiteInfo
CallSiteInfo getSDCallSiteInfo(const SDNode *CallNode)
Definition: SelectionDAG.h:1970
llvm::SelectionDAG::getValidShiftAmountConstant
const APInt * getValidShiftAmountConstant(SDValue V, const APInt &DemandedElts) const
If a SHL/SRA/SRL node V has a constant or splat constant shift amount that is less than the element b...
Definition: SelectionDAG.cpp:2656
llvm::ISD::BlockAddress
@ BlockAddress
Definition: ISDOpcodes.h:84
llvm::SDDbgInfo::clear
void clear()
Definition: SelectionDAG.h:171
llvm::SelectionDAG::getBFI
BlockFrequencyInfo * getBFI() const
Definition: SelectionDAG.h:450
llvm::checkForCycles
void checkForCycles(const SelectionDAG *DAG, bool force=false)
Definition: SelectionDAG.cpp:10674
G
const DataFlowGraph & G
Definition: RDFGraph.cpp:202
llvm::ISD::STRICT_FSETCCS
@ STRICT_FSETCCS
Definition: ISDOpcodes.h:463
llvm::DenseSet
Implements a dense probed hash-table based set.
Definition: DenseSet.h:268
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition: MachineFunction.h:622
llvm::pointer_iterator
Definition: iterator.h:320
llvm::SelectionDAG::ByvalParmDbgBegin
SDDbgInfo::DbgIterator ByvalParmDbgBegin() const
Definition: SelectionDAG.h:1623
llvm::SelectionDAG::OFK_Sometime
@ OFK_Sometime
Definition: SelectionDAG.h:1740
llvm::APFloat
Definition: APFloat.h:701
llvm::SelectionDAG::isKnownNeverZeroFloat
bool isKnownNeverZeroFloat(SDValue Op) const
Test whether the given floating point SDValue is known to never be positive or negative zero.
Definition: SelectionDAG.cpp:4446
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:179
llvm::FoldingSetTrait< SDVTListNode >::Profile
static void Profile(const SDVTListNode &X, FoldingSetNodeID &ID)
Definition: SelectionDAG.h:117
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::SelectionDAG::RemoveDeadNode
void RemoveDeadNode(SDNode *N)
Remove the specified node from the system.
Definition: SelectionDAG.cpp:856
llvm::SelectionDAG::getLoad
SDValue getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType, EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, SDValue Offset, MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
FIXME: Remove once transition to Align is over.
Definition: SelectionDAG.h:1238
llvm::SelectionDAG::SplitVector
std::pair< SDValue, SDValue > SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT, const EVT &HiVT)
Split the vector with EXTRACT_SUBVECTOR using the provides VTs and return the low/high part.
Definition: SelectionDAG.cpp:10241
llvm::EVT::getSizeInBits
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
Definition: ValueTypes.h:341
llvm::FoldingSetTrait
FoldingSetTrait - This trait class is used to define behavior of how to "profile" (in the FoldingSet ...
Definition: FoldingSet.h:257
llvm::DenseMapBase::clear
void clear()
Definition: DenseMap.h:111
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
llvm::SelectionDAG::MaxRecursionDepth
static constexpr unsigned MaxRecursionDepth
Definition: SelectionDAG.h:416
llvm::SelectionDAG::getLifetimeNode
SDValue getLifetimeNode(bool IsStart, const SDLoc &dl, SDValue Chain, int FrameIndex, int64_t Size, int64_t Offset=-1)
Creates a LifetimeSDNode that starts (IsStart==true) or ends (IsStart==false) the lifetime of the por...
Definition: SelectionDAG.cpp:7270
llvm::GraphTraits< SelectionDAG * >::nodes_begin
static nodes_iterator nodes_begin(SelectionDAG *G)
Definition: SelectionDAG.h:2060
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::SelectionDAG::getLibInfo
const TargetLibraryInfo & getLibInfo() const
Definition: SelectionDAG.h:444
llvm::SDDbgInfo::erase
void erase(const SDNode *Node)
Invalidate all DbgValues attached to the node and remove it from the Node-to-DbgValues map.
Definition: SelectionDAG.cpp:898
llvm::SelectionDAG::getIntPtrConstant
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
Definition: SelectionDAG.cpp:1471
llvm::ilist_alloc_traits< SDNode >::deleteNode
static void deleteNode(SDNode *)
Definition: SelectionDAG.h:134
llvm::SelectionDAG::getMaskedGather
SDValue getMaskedGather(SDVTList VTs, EVT MemVT, const SDLoc &dl, ArrayRef< SDValue > Ops, MachineMemOperand *MMO, ISD::MemIndexType IndexType, ISD::LoadExtType ExtTy)
Definition: SelectionDAG.cpp:7724
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:67
llvm::SelectionDAG::mutateStrictFPToFP
SDNode * mutateStrictFPToFP(SDNode *Node)
Mutate the specified strict FP node to its non-strict equivalent, unlinking the node from its chain a...
Definition: SelectionDAG.cpp:8547
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::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::SelectionDAG::getConstantPool
SDValue getConstantPool(const Constant *C, EVT VT, MaybeAlign Align=None, int Offs=0, bool isT=false, unsigned TargetFlags=0)
Definition: SelectionDAG.cpp:1612
llvm::SelectionDAG::getGraphAttrs
std::string getGraphAttrs(const SDNode *N) const
Get graph attributes for a node.
Definition: SelectionDAGPrinter.cpp:207
llvm::SelectionDAG::getCopyFromReg
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
Definition: SelectionDAG.h:761
llvm::DenseMap< const SDNode *, SmallVector< SDDbgValue *, 2 > >
llvm::DemandedBits
Definition: DemandedBits.h:40
llvm::SelectionDAG::shouldOptForSize
bool shouldOptForSize() const
Definition: SelectionDAG.cpp:1166
llvm::SelectionDAG::getLogicalNOT
SDValue getLogicalNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a logical NOT operation as (XOR Val, BooleanOne).
Definition: SelectionDAG.cpp:1328
iterator.h
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::SelectionDAG::getNode
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
Definition: SelectionDAG.cpp:7922
llvm::SelectionDAG::getNOT
SDValue getNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a bitwise NOT operation as (XOR Val, -1).
Definition: SelectionDAG.cpp:1321
llvm::SelectionDAG::updateDivergence
void updateDivergence(SDNode *N)
Definition: SelectionDAG.cpp:9277
llvm::SelectionDAG::allnodes
iterator_range< allnodes_iterator > allnodes()
Definition: SelectionDAG.h:505
llvm::DenormalMode
Represent subnormal handling kind for floating point instruction inputs and outputs.
Definition: FloatingPointMode.h:67
llvm::SelectionDAG::getPseudoProbeNode
SDValue getPseudoProbeNode(const SDLoc &Dl, SDValue Chain, uint64_t Guid, uint64_t Index, uint32_t Attr)
Creates a PseudoProbeSDNode with function GUID Guid and the index of the block Index it is probing,...
Definition: SelectionDAG.cpp:7300
llvm::ilist_alloc_traits
Use delete by default for iplist and ilist.
Definition: ilist.h:40
llvm::SelectionDAG::getSExtOrTrunc
SDValue getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either sign-extending or trunca...
Definition: SelectionDAG.cpp:1269
ArrayRef.h
llvm::SelectionDAG::OFK_Always
@ OFK_Always
Definition: SelectionDAG.h:1741
llvm::SelectionDAG::operator=
SelectionDAG & operator=(const SelectionDAG &)=delete
llvm::SelectionDAG::getAnyExtOrTrunc
SDValue getAnyExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either any-extending or truncat...
Definition: SelectionDAG.cpp:1263
llvm::SelectionDAG::getPSI
ProfileSummaryInfo * getPSI() const
Definition: SelectionDAG.h:449
llvm::SelectionDAG::MorphNodeTo
SDNode * MorphNodeTo(SDNode *N, unsigned Opc, SDVTList VTs, ArrayRef< SDValue > Ops)
This mutates the specified node to have the specified return type, opcode, and operands.
Definition: SelectionDAG.cpp:8494
llvm::SelectionDAG::getAllOnesConstant
SDValue getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget=false, bool IsOpaque=false)
Definition: SelectionDAG.h:622
llvm::SelectionDAG::NewNodesMustHaveLegalTypes
bool NewNodesMustHaveLegalTypes
When true, additional steps are taken to ensure that getConstant() and similar functions return DAG n...
Definition: SelectionDAG.h:355
llvm::DenseMapBase::find
iterator find(const_arg_type_t< KeyT > Val)
Definition: DenseMap.h:150
llvm::MachineMemOperand::Flags
Flags
Flags values. These may be or'd together.
Definition: MachineMemOperand.h:131
llvm::APFloatBase::PPCDoubleDouble
static const fltSemantics & PPCDoubleDouble() LLVM_READNONE
Definition: APFloat.cpp:185
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::SelectionDAG::getVectorShuffle
SDValue getVectorShuffle(EVT VT, const SDLoc &dl, SDValue N1, SDValue N2, ArrayRef< int > Mask)
Return an ISD::VECTOR_SHUFFLE node.
Definition: SelectionDAG.cpp:1777
llvm::SelectionDAG::getMaskedLoad
SDValue getMaskedLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Base, SDValue Offset, SDValue Mask, SDValue Src0, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexedMode AM, ISD::LoadExtType, bool IsExpanding=false)
Definition: SelectionDAG.cpp:7631
llvm::MachineFunction::CallSiteInfoImpl
SmallVectorImpl< ArgRegPair > CallSiteInfoImpl
Definition: MachineFunction.h:419
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::SelectionDAG::getAtomic
SDValue getAtomic(unsigned Opcode, const SDLoc &dl, EVT MemVT, SDValue Chain, SDValue Ptr, SDValue Val, MachineMemOperand *MMO)
Gets a node for an atomic op, produces result (if relevant) and chain and takes 2 operands.
Definition: SelectionDAG.cpp:7163
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:1605
llvm::FunctionLoweringInfo
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
Definition: FunctionLoweringInfo.h:53
llvm::MVT::Other
@ Other
Definition: MachineValueType.h:42
llvm::SelectionDAG::getSelectCC
SDValue getSelectCC(const SDLoc &DL, SDValue LHS, SDValue RHS, SDValue True, SDValue False, ISD::CondCode Cond)
Helper function to make it easier to build SelectCC's if you just have an ISD::CondCode instead of an...
Definition: SelectionDAG.h:1087
llvm::ISD::CondCode
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
Definition: ISDOpcodes.h:1355
iterator_range.h
llvm::SelectionDAG::getCopyFromReg
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT, SDValue Glue)
Definition: SelectionDAG.h:770
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:83
llvm::SelectionDAG::getMachineNode
MachineSDNode * getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT)
These are used for target selectors to create a new node with specified return type(s),...
Definition: SelectionDAG.cpp:8595
llvm::SelectionDAG::getBitcast
SDValue getBitcast(EVT VT, SDValue V)
Return a bitcast using the SDLoc of the value operand, and casting to the provided type.
Definition: SelectionDAG.cpp:2063
llvm::MachineFunction::CallSiteInfo
SmallVector< ArgRegPair, 1 > CallSiteInfo
Vector of call argument and its forwarding register.
Definition: MachineFunction.h:418
llvm::SelectionDAG::isGuaranteedNotToBePoison
bool isGuaranteedNotToBePoison(SDValue Op, unsigned Depth=0) const
Return true if this function can prove that Op is never poison.
Definition: SelectionDAG.h:1785
llvm::SelectionDAG::setNodeMemRefs
void setNodeMemRefs(MachineSDNode *N, ArrayRef< MachineMemOperand * > NewMemRefs)
Mutate the specified machine node's memory references to the provided list.
Definition: SelectionDAG.cpp:8363
llvm::MDNode
Metadata node.
Definition: Metadata.h:897
llvm::SelectionDAG::haveNoCommonBitsSet
bool haveNoCommonBitsSet(SDValue A, SDValue B) const
Return true if A and B have no common bits set.
Definition: SelectionDAG.cpp:4494
llvm::SelectionDAG::CreateStackTemporary
SDValue CreateStackTemporary(TypeSize Bytes, Align Alignment)
Create a stack temporary based on the size in bytes and the alignment.
Definition: SelectionDAG.cpp:2181
llvm::FoldingSetTrait< SDVTListNode >::Equals
static bool Equals(const SDVTListNode &X, const FoldingSetNodeID &ID, unsigned IDHash, FoldingSetNodeID &TempID)
Definition: SelectionDAG.h:121
llvm::SelectionDAG::SelectNodeTo
SDNode * SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT)
These are used for target selectors to mutate the specified node to have the specified return type,...
Definition: SelectionDAG.cpp:8387
llvm::MVT::bf16
@ bf16
Definition: MachineValueType.h:53
llvm::SelectionDAG::getTokenFactor
SDValue getTokenFactor(const SDLoc &DL, SmallVectorImpl< SDValue > &Vals)
Creates a new TokenFactor containing Vals.
Definition: SelectionDAG.cpp:10580
llvm::SelectionDAG::getGlobalAddress
SDValue getGlobalAddress(const GlobalValue *GV, const SDLoc &DL, EVT VT, int64_t offset=0, bool isTargetGA=false, unsigned TargetFlags=0)
Definition: SelectionDAG.cpp:1545
llvm::APInt
Class for arbitrary precision integers.
Definition: APInt.h:70
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::SelectionDAG::getORE
OptimizationRemarkEmitter & getORE() const
Definition: SelectionDAG.h:448
llvm::SelectionDAG::getCALLSEQ_END
SDValue getCALLSEQ_END(SDValue Chain, SDValue Op1, SDValue Op2, SDValue InGlue, const SDLoc &DL)
Return a new CALLSEQ_END node, which always must have a glue result (to ensure it's not CSE'd).
Definition: SelectionDAG.h:935
llvm::ISD::VSCALE
@ VSCALE
VSCALE(IMM) - Returns the runtime scaling factor used to calculate the number of elements within a sc...
Definition: ISDOpcodes.h:1202
llvm::SelectionDAG::allnodes_size
ilist< SDNode >::size_type allnodes_size() const
Definition: SelectionDAG.h:501
llvm::SDDbgInfo::DbgLabelEnd
DbgLabelIterator DbgLabelEnd()
Definition: SelectionDAG.h:200
llvm::BlockAddress
The address of a basic block.
Definition: Constants.h:848
llvm::SelectionDAG::clearGraphAttrs
void clearGraphAttrs()
Clear all previously defined node graph attributes.
Definition: SelectionDAGPrinter.cpp:183
llvm::SelectionDAG::getTargetConstantPool
SDValue getTargetConstantPool(const Constant *C, EVT VT, MaybeAlign Align=None, int Offset=0, unsigned TargetFlags=0)
Definition: SelectionDAG.h:699
llvm::FoldingSet
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
Definition: FoldingSet.h:493
llvm::SelectionDAG::SplitVector
std::pair< SDValue, SDValue > SplitVector(const SDValue &N, const SDLoc &DL)
Split the vector with EXTRACT_SUBVECTOR and return the low/high part.
Definition: SelectionDAG.h:1921
llvm::SelectionDAG::getDbgValueList
SDDbgValue * getDbgValueList(DIVariable *Var, DIExpression *Expr, ArrayRef< SDDbgOperand > Locs, ArrayRef< SDNode * > Dependencies, bool IsIndirect, const DebugLoc &DL, unsigned O, bool IsVariadic)
Creates a SDDbgValue node from a list of locations.
Definition: SelectionDAG.cpp:8834
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::EVT::isVector
bool isVector() const
Return true if this is a vector value type.
Definition: ValueTypes.h:155
llvm::SelectionDAG::getAtomicMemcpy
SDValue getAtomicMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst, unsigned DstAlign, SDValue Src, unsigned SrcAlign, SDValue Size, Type *SizeTy, unsigned ElemSz, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
Definition: SelectionDAG.cpp:6885
llvm::SelectionDAG::getSelect
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS)
Helper function to make it easier to build Select's if you just have operands and don't want to check...
Definition: SelectionDAG.h:1075
llvm::SelectionDAG::getTargetConstant
SDValue getTargetConstant(const APInt &Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
Definition: SelectionDAG.h:641
llvm::OptimizationRemarkEmitter
The optimization diagnostic interface.
Definition: OptimizationRemarkEmitter.h:33
llvm::APInt::getAllOnesValue
static APInt getAllOnesValue(unsigned numBits)
Get the all-ones value.
Definition: APInt.h:567
Cond
SmallVector< MachineOperand, 4 > Cond
Definition: BasicBlockSections.cpp:179
llvm::APFloatBase::IEEEdouble
static const fltSemantics & IEEEdouble() LLVM_READNONE
Definition: APFloat.cpp:173
llvm::SelectionDAG::getTargetInsertSubreg
SDValue getTargetInsertSubreg(int SRIdx, const SDLoc &DL, EVT VT, SDValue Operand, SDValue Subreg)
A convenience function for creating TargetInstrInfo::INSERT_SUBREG nodes.
Definition: SelectionDAG.cpp:8723
llvm::EVT::getScalarSizeInBits
uint64_t getScalarSizeInBits() const
Definition: ValueTypes.h:353
llvm::FoldingSetBase::Node
Node - This class is used to maintain the singly linked bucket list in a folding set.
Definition: FoldingSet.h:133
llvm::SelectionDAG::getLoad
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
FIXME: Remove once transition to Align is over.
Definition: SelectionDAG.h:1188
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::SDDbgInfo::add
void add(SDDbgLabel *L)
Definition: SelectionDAG.h:165
llvm::SelectionDAG::getBlockAddress
SDValue getBlockAddress(const BlockAddress *BA, EVT VT, int64_t Offset=0, bool isTarget=false, unsigned TargetFlags=0)
Definition: SelectionDAG.cpp:2013
llvm::SelectionDAG::ReplaceAllUsesOfValueWith
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.getNode() alone.
Definition: SelectionDAG.cpp:9183
llvm::SelectionDAG::WidenVector
SDValue WidenVector(const SDValue &N, const SDLoc &DL)
Widen the vector up to the next power of two using INSERT_SUBVECTOR.
Definition: SelectionDAG.cpp:10263
A
* A
Definition: README_ALTIVEC.txt:89
uint32_t
llvm::SelectionDAG::setFunctionLoweringInfo
void setFunctionLoweringInfo(FunctionLoweringInfo *FuncInfo)
Definition: SelectionDAG.h:429
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::SelectionDAG::addHeapAllocSite
void addHeapAllocSite(const SDNode *Node, MDNode *MD)
Definition: SelectionDAG.h:1977
llvm::FoldingSetNodeID
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Definition: FoldingSet.h:313
llvm::ISD::UNDEF
@ UNDEF
UNDEF - An undefined node.
Definition: ISDOpcodes.h:211
llvm::PICLevel::Level
Level
Definition: CodeGen.h:33
Node
Definition: ItaniumDemangle.h:114
llvm::DIVariable
Base class for variables.
Definition: DebugInfoMetadata.h:2489
llvm::AMDGPUISD::BFI
@ BFI
Definition: AMDGPUISelLowering.h:421
llvm::SelectionDAG::getShiftAmountOperand
SDValue getShiftAmountOperand(EVT LHSTy, SDValue Op)
Return the specified value casted to the target's desired shift amount type.
Definition: SelectionDAG.cpp:2097
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::SelectionDAG::getBasicBlock
SDValue getBasicBlock(MachineBasicBlock *MBB)
Definition: SelectionDAG.cpp:1683
llvm::SDVTList
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
Definition: SelectionDAGNodes.h:79
llvm::SelectionDAG::getReducedAlign
Align getReducedAlign(EVT VT, bool UseABI)
In most cases this function returns the ABI alignment for a given type, except for illegal vector typ...
Definition: SelectionDAG.cpp:2153
llvm::TargetSubtargetInfo
TargetSubtargetInfo - Generic base class for all target subtargets.
Definition: TargetSubtargetInfo.h:59
llvm::SelectionDAG::LegalizeOp
bool LegalizeOp(SDNode *N, SmallSetVector< SDNode *, 16 > &UpdatedNodes)
Transforms a SelectionDAG node and any operands to it into a node that is compatible with the target ...
Definition: LegalizeDAG.cpp:4982
llvm::SelectionDAG::getNeutralElement
SDValue getNeutralElement(unsigned Opcode, const SDLoc &DL, EVT VT, SDNodeFlags Flags)
Get the (commutative) neutral element for the given opcode, if it exists.
Definition: SelectionDAG.cpp:10593
llvm::SelectionDAG::getBuildVector
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
Definition: SelectionDAG.h:790
llvm::SelectionDAG::DAGUpdateListener::Next
DAGUpdateListener *const Next
Definition: SelectionDAG.h:289
llvm::SelectionDAG::getConstantFP
SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant value.
Definition: SelectionDAG.cpp:1527
llvm::MachineMemOperand::MOLoad
@ MOLoad
The memory access reads data.
Definition: MachineMemOperand.h:135
llvm::GraphTraits< SelectionDAG * >::nodes_end
static nodes_iterator nodes_end(SelectionDAG *G)
Definition: SelectionDAG.h:2064
llvm::SDVTListNode::SDVTListNode
SDVTListNode(const FoldingSetNodeIDRef ID, const EVT *VT, unsigned int Num)
Definition: SelectionDAG.h:103
FoldingSet.h
llvm::SelectionDAG::getTargetJumpTable
SDValue getTargetJumpTable(int JTI, EVT VT, unsigned TargetFlags=0)
Definition: SelectionDAG.h:693
llvm::ArrayRecycler
Recycle small arrays allocated from a BumpPtrAllocator.
Definition: ArrayRecycler.h:28
llvm::SelectionDAG::OFK_Never
@ OFK_Never
Definition: SelectionDAG.h:1739
llvm::ISD::FrameIndex
@ FrameIndex
Definition: ISDOpcodes.h:80
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::SelectionDAG::getDenormalMode
DenormalMode getDenormalMode(EVT VT) const
Return the current function's default denormal handling kind for the given floating point type.
Definition: SelectionDAG.h:2003
llvm::SelectionDAG::isConstantFPBuildVectorOrConstantFP
SDNode * isConstantFPBuildVectorOrConstantFP(SDValue N) const
Test whether the given value is a constant FP or similar node.
Definition: SelectionDAG.cpp:10547
llvm::SelectionDAG::ByvalParmDbgEnd
SDDbgInfo::DbgIterator ByvalParmDbgEnd() const
Definition: SelectionDAG.h:1626
llvm::SelectionDAG::FoldSymbolOffset
SDValue FoldSymbolOffset(unsigned Opcode, EVT VT, const GlobalAddressSDNode *GA, const SDNode *N2)
Definition: SelectionDAG.cpp:5163
llvm::RecyclingAllocator< BumpPtrAllocator, SDNode, sizeof(LargestSDNode), alignof(MostAlignedSDNode)>
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::SelectionDAG::salvageDebugInfo
void salvageDebugInfo(SDNode &N)
To be invoked on an SDNode that is slated to be erased.
Definition: SelectionDAG.cpp:8928
llvm::SelectionDAG::DAGNodeDeletedListener::Callback
std::function< void(SDNode *, SDNode *)> Callback
Definition: SelectionDAG.h:315
std
Definition: BitVector.h:838
llvm::SelectionDAG::computeKnownBits
KnownBits computeKnownBits(SDValue Op, unsigned Depth=0) const
Determine which bits of Op are known to be either zero or one and return them in Known.
Definition: SelectionDAG.cpp:2732
llvm::GlobalAddressSDNode
Definition: SelectionDAGNodes.h:1700
llvm::KnownBits
Definition: KnownBits.h:23
llvm::SelectionDAG::UnrollVectorOp
SDValue UnrollVectorOp(SDNode *N, unsigned ResNE=0)
Utility function used by legalize and lowering to "unroll" a vector operation by splitting out the sc...
Definition: SelectionDAG.cpp:10014
uint16_t
llvm::EVT::getScalarType
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
Definition: ValueTypes.h:296
llvm::DenseMapBase::end
iterator end()
Definition: DenseMap.h:83
llvm::AMDGPU::SendMsg::Op
Op
Definition: SIDefines.h:314
llvm::ilist_iterator
Iterator for intrusive lists based on ilist_node.
Definition: ilist_iterator.h:57
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::SelectionDAG::getEntryNode
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
Definition: SelectionDAG.h:516
llvm::APInt::sextOrTrunc
APInt sextOrTrunc(unsigned width) const
Sign extend or truncate to width.
Definition: APInt.cpp:960
llvm::SelectionDAG::getDataLayout
const DataLayout & getDataLayout() const
Definition: SelectionDAG.h:440
llvm::SelectionDAG::dumpDotGraph
LLVM_DUMP_METHOD void dumpDotGraph(const Twine &FileName, const Twine &Title)
Just dump dot graph to a user-provided path and title.
Definition: SelectionDAGPrinter.cpp:175
ISDOpcodes.h
llvm::DefaultFoldingSetTrait
DefaultFoldingSetTrait - This class provides default implementations for FoldingSetTrait implementati...
Definition: FoldingSet.h:228
llvm::TypeSize
Definition: TypeSize.h:417
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::fltSemantics
Definition: APFloat.cpp:54
llvm::SelectionDAG::Combine
void Combine(CombineLevel Level, AAResults *AA, CodeGenOpt::Level OptLevel)
This iterates over the nodes in the SelectionDAG, folding certain types of nodes together,...
Definition: DAGCombiner.cpp:23427
llvm::SelectionDAG::getTargetExtractSubreg
SDValue getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT, SDValue Operand)
A convenience function for creating TargetInstrInfo::EXTRACT_SUBREG nodes.
Definition: SelectionDAG.cpp:8713
llvm::SelectionDAG::AddDbgValue
void AddDbgValue(SDDbgValue *DB, bool isParameter)
Add a dbg_value SDNode.
Definition: SelectionDAG.cpp:9469
llvm::SelectionDAG::OverflowKind
OverflowKind
Used to represent the possible overflow behavior of an operation.
Definition: SelectionDAG.h:1738
llvm::SelectionDAG::calculateDivergence
bool calculateDivergence(SDNode *N)
Definition: SelectionDAG.cpp:9262
llvm::SDDbgInfo::getSDDbgValues
ArrayRef< SDDbgValue * > getSDDbgValues(const SDNode *Node) const
Definition: SelectionDAG.h:185
llvm::SelectionDAG::getTargetExternalSymbol
SDValue getTargetExternalSymbol(const char *Sym, EVT VT, unsigned TargetFlags=0)
Definition: SelectionDAG.cpp:1728
llvm::SelectionDAG::getMCSymbol
SDValue getMCSymbol(MCSymbol *Sym, EVT VT)
Definition: SelectionDAG.cpp:1719
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::SelectionDAG::simplifyShift
SDValue simplifyShift(SDValue X, SDValue Y)
Try to simplify a shift into 1 of its operands or a constant.
Definition: SelectionDAG.cpp:7847
llvm::TargetLibraryInfo
Provides information about what library functions are available for the current target.
Definition: TargetLibraryInfo.h:219
llvm::SDValue
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
Definition: SelectionDAGNodes.h:138
llvm::SelectionDAG::LegalizeVectors
bool LegalizeVectors()
This transforms the SelectionDAG into a SelectionDAG that only uses vector math operations supported ...
Definition: LegalizeVectorOps.cpp:1547
RecyclingAllocator.h
llvm::SDNodeFlags
These are IR-level optimization flags that may be propagated to SDNodes.
Definition: SelectionDAGNodes.h:371
llvm::SmallVectorImpl::clear
void clear()
Definition: SmallVector.h:585
llvm::SelectionDAG::RepositionNode
void RepositionNode(allnodes_iterator Position, SDNode *N)
Move node N in the AllNodes list to be immediately before the given iterator Position.
Definition: SelectionDAG.h:1584
llvm::SelectionDAG::FoldConstantArithmetic
SDValue FoldConstantArithmetic(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDValue > Ops)
Definition: SelectionDAG.cpp:5208
llvm::SelectionDAG::getStore
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
FIXME: Remove once transition to Align is over.
Definition: SelectionDAG.h:1272
llvm::MachineMemOperand::MOStore
@ MOStore
The memory access writes data.
Definition: MachineMemOperand.h:137
llvm::SelectionDAG::DbgEnd
SDDbgInfo::DbgIterator DbgEnd() const
Definition: SelectionDAG.h:1621
llvm::FoldingSetNodeIDRef
FoldingSetNodeIDRef - This class describes a reference to an interned FoldingSetNodeID,...
Definition: FoldingSet.h:285
llvm::SelectionDAG::getBuildVector
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDUse > Ops)
Return an ISD::BUILD_VECTOR node.
Definition: SelectionDAG.h:799
llvm::makeArrayRef
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Definition: ArrayRef.h:476
llvm::SelectionDAG::getShiftAmountConstant
SDValue getShiftAmountConstant(uint64_t Val, EVT VT, const SDLoc &DL, bool LegalTypes=true)
Definition: SelectionDAG.cpp:1476
llvm::SelectionDAG::computeOverflowKind
OverflowKind computeOverflowKind(SDValue N0, SDValue N1) const
Determine if the result of the addition of 2 node can overflow.
Definition: SelectionDAG.cpp:3586
llvm::iplist_impl< simple_ilist< T, Options... >, ilist_traits< T > >::insert
iterator insert(iterator where, pointer New)
Definition: ilist.h:228
CodeGen.h
llvm::SelectionDAG::getBoolConstant
SDValue getBoolConstant(bool V, const SDLoc &DL, EVT VT, EVT OpVT)
Create a true or false constant of type VT using the target's BooleanContent for type OpVT.
Definition: SelectionDAG.cpp:1333
llvm::EVT::getVectorElementType
EVT getVectorElementType() const
Given a vector type, return the type of each element.
Definition: ValueTypes.h:301
llvm::SelectionDAG::GetSplitDestVTs
std::pair< EVT, EVT > GetSplitDestVTs(const EVT &VT) const
Compute the VTs needed for the low/hi parts of a type which is split (or expanded) into two not neces...
Definition: SelectionDAG.cpp:10196
llvm::CombineLevel
CombineLevel
Definition: DAGCombine.h:15
llvm::Pass
Pass interface - Implemented by all 'passes'.
Definition: Pass.h:91
Instructions.h
llvm::MVT::f128
@ f128
Definition: MachineValueType.h:58
SmallVector.h
llvm::SelectionDAG::getAtomicMemmove
SDValue getAtomicMemmove(SDValue Chain, const SDLoc &dl, SDValue Dst, unsigned DstAlign, SDValue Src, unsigned SrcAlign, SDValue Size, Type *SizeTy, unsigned ElemSz, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo)
Definition: SelectionDAG.cpp:6988
ArrayRecycler.h
llvm::SelectionDAG::getIndexedLoad
SDValue getIndexedLoad(SDValue OrigLoad, const SDLoc &dl, SDValue Base, SDValue Offset, ISD::MemIndexedMode AM)
Definition: SelectionDAG.cpp:7472
llvm::SelectionDAG::MaskedValueIsAllOnes
bool MaskedValueIsAllOnes(SDValue Op, const APInt &Mask, unsigned Depth=0) const
Return true if '(Op & Mask) == Mask'.
Definition: SelectionDAG.cpp:2453
llvm::MVT::f16
@ f16
Definition: MachineValueType.h:54
llvm::SmallVectorImpl::iterator
typename SuperClass::iterator iterator
Definition: SmallVector.h:562
llvm::SDNodeFlags::setNoUnsignedWrap
void setNoUnsignedWrap(bool b)
Definition: SelectionDAGNodes.h:411
N
#define N
llvm::SelectionDAG::FlagInserter::operator=
FlagInserter & operator=(const FlagInserter &)=delete
llvm::SelectionDAG::getTargetConstantFP
SDValue getTargetConstantFP(double Val, const SDLoc &DL, EVT VT)
Definition: SelectionDAG.h:669
llvm::SelectionDAG::AddDbgLabel
void AddDbgLabel(SDDbgLabel *DB)
Add a dbg_label SDNode.
Definition: SelectionDAG.cpp:9479
llvm::SelectionDAG::allnodes_end
allnodes_iterator allnodes_end()
Definition: SelectionDAG.h:499
llvm::SelectionDAG::getRegisterMask
SDValue getRegisterMask(const uint32_t *RegMask)
Definition: SelectionDAG.cpp:1975
llvm::SelectionDAG::getMemset
SDValue getMemset(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, Align Alignment, bool isVol, bool isTailCall, MachinePointerInfo DstPtrInfo, const AAMDNodes &AAInfo=AAMDNodes())
Definition: SelectionDAG.cpp:7029
llvm::SelectionDAG::getLabelNode
SDValue getLabelNode(unsigned Opcode, const SDLoc &dl, SDValue Root, MCSymbol *Label)
Definition: SelectionDAG.cpp:1994
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::SelectionDAG::getPtrExtendInReg
SDValue getPtrExtendInReg(SDValue Op, const SDLoc &DL, EVT VT)
Return the expression required to extend the Op as a pointer value assuming it was the smaller SrcTy ...
Definition: SelectionDAG.cpp:1314
llvm::MachineFunction::getDataLayout
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
Definition: MachineFunction.cpp:260
llvm::SelectionDAG::getStepVector
SDValue getStepVector(const SDLoc &DL, EVT ResVT, APInt StepVal)
Returns a vector of type ResVT whose elements contain the linear sequence <0, Step,...
Definition: SelectionDAG.cpp:1756
llvm::SelectionDAG::getPass
const Pass * getPass() const
Definition: SelectionDAG.h:438
llvm::SelectionDAG::getJumpTable
SDValue getJumpTable(int JTI, EVT VT, bool isTarget=false, unsigned TargetFlags=0)
Definition: SelectionDAG.cpp:1593
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::SelectionDAG::getAtomicCmpSwap
SDValue getAtomicCmpSwap(unsigned Opcode, const SDLoc &dl, EVT MemVT, SDVTList VTs, SDValue Chain, SDValue Ptr, SDValue Cmp, SDValue Swp, MachineMemOperand *MMO)
Gets a node for an atomic cmpxchg op.
Definition: SelectionDAG.cpp:7151
llvm::SelectionDAG::DAGNodeDeletedListener::NodeDeleted
void NodeDeleted(SDNode *N, SDNode *E) override
The node N that was deleted and, if E is not null, an equivalent node E that replaced it.
Definition: SelectionDAG.h:321
llvm::SelectionDAG::getTargetConstant
SDValue getTargetConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isOpaque=false)
Definition: SelectionDAG.h:637
llvm::SmallSetVector
A SetVector that performs no allocations if smaller than a certain size.
Definition: SetVector.h:307
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::SelectionDAG::DeleteNode
void DeleteNode(SDNode *N)
Remove the specified node from the system.
Definition: SelectionDAG.cpp:867
llvm::SelectionDAG::getTruncStore
SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT SVT, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Definition: SelectionDAG.h:1287
llvm::SelectionDAG::getMachineFunction
MachineFunction & getMachineFunction() const
Definition: SelectionDAG.h:437
llvm::SelectionDAG::ComputeNumSignBits
unsigned ComputeNumSignBits(SDValue Op, unsigned Depth=0) const
Return the number of times the sign bit of the register is replicated into the other bits.
Definition: SelectionDAG.cpp:3658
llvm::SelectionDAG::UnrollVectorOverflowOp
std::pair< SDValue, SDValue > UnrollVectorOverflowOp(SDNode *N, unsigned ResNE=0)
Like UnrollVectorOp(), but for the [US](ADD|SUB|MUL)O family of opcodes.
Definition: SelectionDAG.cpp:10082
llvm::DILabel
Label.
Definition: DebugInfoMetadata.h:3133
llvm::SelectionDAG::getHeapAllocSite
MDNode * getHeapAllocSite(const SDNode *Node)
Return the HeapAllocSite type associated with the SDNode, if it exists.
Definition: SelectionDAG.h:1982
llvm::SelectionDAG::getExternalSymbol
SDValue getExternalSymbol(const char *Sym, EVT VT)
Definition: SelectionDAG.cpp:1711
llvm::SelectionDAG::isConstantValueOfAnyType
bool isConstantValueOfAnyType(SDValue N) const
Definition: SelectionDAG.h:1961
llvm::GraphTraits
Definition: GraphTraits.h:35
From
BlockVerifier::State From
Definition: BlockVerifier.cpp:55
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::SelectionDAG::getMDNode
SDValue getMDNode(const MDNode *MD)
Return an MDNodeSDNode which holds an MDNode.
Definition: SelectionDAG.cpp:2048
llvm::AMDGPU::HSAMD::Kernel::Key::Args
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Definition: AMDGPUMetadata.h:389
llvm::SDDbgInfo::ByvalParmDbgEnd
DbgIterator ByvalParmDbgEnd()
Definition: SelectionDAG.h:198
llvm::SDDbgInfo::add
void add(SDDbgValue *V, bool isParameter)
Definition: SelectionDAG.cpp:887
llvm::SelectionDAG::DAGUpdateListener
Clients of various APIs that cause global effects on the DAG can optionally implement this interface.
Definition: SelectionDAG.h:288
llvm::SelectionDAG::getMemcpy
SDValue getMemcpy(SDValue Chain, const SDLoc &dl, SDValue Dst, SDValue Src, SDValue Size, Align Alignment, bool isVol, bool AlwaysInline, bool isTailCall, MachinePointerInfo DstPtrInfo, MachinePointerInfo SrcPtrInfo, const AAMDNodes &AAInfo=AAMDNodes())
Definition: SelectionDAG.cpp:6811
llvm::SDDbgInfo::DbgEnd
DbgIterator DbgEnd()
Definition: SelectionDAG.h:196
MachineFunction.h
llvm::SDDbgInfo::DbgIterator
SmallVectorImpl< SDDbgValue * >::iterator DbgIterator
Definition: SelectionDAG.h:192
llvm::SelectionDAG::getSplatValue
SDValue getSplatValue(SDValue V, bool LegalTypes=false)
If V is a splat vector, return its scalar source operand by extracting that element from the source v...
Definition: SelectionDAG.cpp:2637
llvm::SelectionDAG::getStackArgumentTokenFactor
SDValue getStackArgumentTokenFactor(SDValue Chain)
Compute a TokenFactor to force all the incoming stack arguments to be loaded from the stack.
Definition: SelectionDAG.cpp:6218
llvm::MachineMemOperand::MONone
@ MONone
Definition: MachineMemOperand.h:133
llvm::SelectionDAG::getMaskedScatter
SDValue getMaskedScatter(SDVTList VTs, EVT MemVT, const SDLoc &dl, ArrayRef< SDValue > Ops, MachineMemOperand *MMO, ISD::MemIndexType IndexType, bool IsTruncating=false)
Definition: SelectionDAG.cpp:7771
llvm::SelectionDAG::getExtLoad
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Definition: SelectionDAG.cpp:7453
llvm::MVT::f32
@ f32
Definition: MachineValueType.h:55
llvm::SelectionDAG::makeEquivalentMemoryOrdering
SDValue makeEquivalentMemoryOrdering(SDValue OldChain, SDValue NewMemOpChain)
If an existing load has uses of its chain, create a token factor node with that chain and the new mem...
Definition: SelectionDAG.cpp:9481
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::SelectionDAG::getTarget
const TargetMachine & getTarget() const
Definition: SelectionDAG.h:441
llvm::SelectionDAG::DbgLabelEnd
SDDbgInfo::DbgLabelIterator DbgLabelEnd() const
Definition: SelectionDAG.h:1633
llvm::SelectionDAG::getFrameIndexDbgValue
SDDbgValue * getFrameIndexDbgValue(DIVariable *Var, DIExpression *Expr, unsigned FI, bool IsIndirect, const DebugLoc &DL, unsigned O)
Creates a FrameIndex SDDbgValue node.
Definition: SelectionDAG.cpp:8797
llvm::SelectionDAG::getIndexedMaskedStore
SDValue getIndexedMaskedStore(SDValue OrigStore, const SDLoc &dl, SDValue Base, SDValue Offset, ISD::MemIndexedMode AM)
Definition: SelectionDAG.cpp:7713
llvm::ISD::MCSymbol
@ MCSymbol
Definition: ISDOpcodes.h:172
llvm::SelectionDAG::getSetCC
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
Definition: SelectionDAG.h:1058
SetVector.h
llvm::SelectionDAG::getMergeValues
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
Definition: SelectionDAG.cpp:7202
llvm::sampleprof::Base
@ Base
Definition: Discriminator.h:58
llvm::SelectionDAG::getTargetIndex
SDValue getTargetIndex(int Index, EVT VT, int64_t Offset=0, unsigned TargetFlags=0)
Definition: SelectionDAG.cpp:1666
llvm::EVT::getSimpleVT
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
Definition: ValueTypes.h:289
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:38
llvm::ISD::VSELECT
@ VSELECT
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
Definition: ISDOpcodes.h:688
llvm::SelectionDAG::getCondCode
SDValue getCondCode(ISD::CondCode Cond)
Definition: SelectionDAG.cpp:1738
llvm::SelectionDAG::areNonVolatileConsecutiveLoads
bool areNonVolatileConsecutiveLoads(LoadSDNode *LD, LoadSDNode *Base, unsigned Bytes, int Dist) const
Return true if loads are next to each other and can be merged.
Definition: SelectionDAG.cpp:10132