LLVM  5.0.0
SelectionDAGDumper.cpp
Go to the documentation of this file.
1 //===-- SelectionDAGDumper.cpp - Implement SelectionDAG::dump() -----------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This implements the SelectionDAG::dump method and friends.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "ScheduleDAGSDNodes.h"
15 #include "llvm/ADT/StringExtras.h"
20 #include "llvm/IR/DebugInfo.h"
21 #include "llvm/IR/Function.h"
22 #include "llvm/IR/Intrinsics.h"
23 #include "llvm/Support/Debug.h"
25 #include "llvm/Support/Printable.h"
32 using namespace llvm;
33 
34 static cl::opt<bool>
35 VerboseDAGDumping("dag-dump-verbose", cl::Hidden,
36  cl::desc("Display more information when dumping selection "
37  "DAG nodes."));
38 
39 std::string SDNode::getOperationName(const SelectionDAG *G) const {
40  switch (getOpcode()) {
41  default:
43  return "<<Unknown DAG Node>>";
44  if (isMachineOpcode()) {
45  if (G)
46  if (const TargetInstrInfo *TII = G->getSubtarget().getInstrInfo())
47  if (getMachineOpcode() < TII->getNumOpcodes())
48  return TII->getName(getMachineOpcode());
49  return "<<Unknown Machine Node #" + utostr(getOpcode()) + ">>";
50  }
51  if (G) {
52  const TargetLowering &TLI = G->getTargetLoweringInfo();
53  const char *Name = TLI.getTargetNodeName(getOpcode());
54  if (Name) return Name;
55  return "<<Unknown Target Node #" + utostr(getOpcode()) + ">>";
56  }
57  return "<<Unknown Node #" + utostr(getOpcode()) + ">>";
58 
59 #ifndef NDEBUG
60  case ISD::DELETED_NODE: return "<<Deleted Node!>>";
61 #endif
62  case ISD::PREFETCH: return "Prefetch";
63  case ISD::ATOMIC_FENCE: return "AtomicFence";
64  case ISD::ATOMIC_CMP_SWAP: return "AtomicCmpSwap";
65  case ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS: return "AtomicCmpSwapWithSuccess";
66  case ISD::ATOMIC_SWAP: return "AtomicSwap";
67  case ISD::ATOMIC_LOAD_ADD: return "AtomicLoadAdd";
68  case ISD::ATOMIC_LOAD_SUB: return "AtomicLoadSub";
69  case ISD::ATOMIC_LOAD_AND: return "AtomicLoadAnd";
70  case ISD::ATOMIC_LOAD_OR: return "AtomicLoadOr";
71  case ISD::ATOMIC_LOAD_XOR: return "AtomicLoadXor";
72  case ISD::ATOMIC_LOAD_NAND: return "AtomicLoadNand";
73  case ISD::ATOMIC_LOAD_MIN: return "AtomicLoadMin";
74  case ISD::ATOMIC_LOAD_MAX: return "AtomicLoadMax";
75  case ISD::ATOMIC_LOAD_UMIN: return "AtomicLoadUMin";
76  case ISD::ATOMIC_LOAD_UMAX: return "AtomicLoadUMax";
77  case ISD::ATOMIC_LOAD: return "AtomicLoad";
78  case ISD::ATOMIC_STORE: return "AtomicStore";
79  case ISD::PCMARKER: return "PCMarker";
80  case ISD::READCYCLECOUNTER: return "ReadCycleCounter";
81  case ISD::SRCVALUE: return "SrcValue";
82  case ISD::MDNODE_SDNODE: return "MDNode";
83  case ISD::EntryToken: return "EntryToken";
84  case ISD::TokenFactor: return "TokenFactor";
85  case ISD::AssertSext: return "AssertSext";
86  case ISD::AssertZext: return "AssertZext";
87 
88  case ISD::BasicBlock: return "BasicBlock";
89  case ISD::VALUETYPE: return "ValueType";
90  case ISD::Register: return "Register";
91  case ISD::RegisterMask: return "RegisterMask";
92  case ISD::Constant:
93  if (cast<ConstantSDNode>(this)->isOpaque())
94  return "OpaqueConstant";
95  return "Constant";
96  case ISD::ConstantFP: return "ConstantFP";
97  case ISD::GlobalAddress: return "GlobalAddress";
98  case ISD::GlobalTLSAddress: return "GlobalTLSAddress";
99  case ISD::FrameIndex: return "FrameIndex";
100  case ISD::JumpTable: return "JumpTable";
101  case ISD::GLOBAL_OFFSET_TABLE: return "GLOBAL_OFFSET_TABLE";
102  case ISD::RETURNADDR: return "RETURNADDR";
103  case ISD::ADDROFRETURNADDR: return "ADDROFRETURNADDR";
104  case ISD::FRAMEADDR: return "FRAMEADDR";
105  case ISD::LOCAL_RECOVER: return "LOCAL_RECOVER";
106  case ISD::READ_REGISTER: return "READ_REGISTER";
107  case ISD::WRITE_REGISTER: return "WRITE_REGISTER";
108  case ISD::FRAME_TO_ARGS_OFFSET: return "FRAME_TO_ARGS_OFFSET";
109  case ISD::EH_DWARF_CFA: return "EH_DWARF_CFA";
110  case ISD::EH_RETURN: return "EH_RETURN";
111  case ISD::EH_SJLJ_SETJMP: return "EH_SJLJ_SETJMP";
112  case ISD::EH_SJLJ_LONGJMP: return "EH_SJLJ_LONGJMP";
113  case ISD::EH_SJLJ_SETUP_DISPATCH: return "EH_SJLJ_SETUP_DISPATCH";
114  case ISD::ConstantPool: return "ConstantPool";
115  case ISD::TargetIndex: return "TargetIndex";
116  case ISD::ExternalSymbol: return "ExternalSymbol";
117  case ISD::BlockAddress: return "BlockAddress";
119  case ISD::INTRINSIC_VOID:
120  case ISD::INTRINSIC_W_CHAIN: {
121  unsigned OpNo = getOpcode() == ISD::INTRINSIC_WO_CHAIN ? 0 : 1;
122  unsigned IID = cast<ConstantSDNode>(getOperand(OpNo))->getZExtValue();
123  if (IID < Intrinsic::num_intrinsics)
124  return Intrinsic::getName((Intrinsic::ID)IID, None);
125  else if (const TargetIntrinsicInfo *TII = G->getTarget().getIntrinsicInfo())
126  return TII->getName(IID);
127  llvm_unreachable("Invalid intrinsic ID");
128  }
129 
130  case ISD::BUILD_VECTOR: return "BUILD_VECTOR";
131  case ISD::TargetConstant:
132  if (cast<ConstantSDNode>(this)->isOpaque())
133  return "OpaqueTargetConstant";
134  return "TargetConstant";
135  case ISD::TargetConstantFP: return "TargetConstantFP";
136  case ISD::TargetGlobalAddress: return "TargetGlobalAddress";
137  case ISD::TargetGlobalTLSAddress: return "TargetGlobalTLSAddress";
138  case ISD::TargetFrameIndex: return "TargetFrameIndex";
139  case ISD::TargetJumpTable: return "TargetJumpTable";
140  case ISD::TargetConstantPool: return "TargetConstantPool";
141  case ISD::TargetExternalSymbol: return "TargetExternalSymbol";
142  case ISD::MCSymbol: return "MCSymbol";
143  case ISD::TargetBlockAddress: return "TargetBlockAddress";
144 
145  case ISD::CopyToReg: return "CopyToReg";
146  case ISD::CopyFromReg: return "CopyFromReg";
147  case ISD::UNDEF: return "undef";
148  case ISD::MERGE_VALUES: return "merge_values";
149  case ISD::INLINEASM: return "inlineasm";
150  case ISD::EH_LABEL: return "eh_label";
151  case ISD::HANDLENODE: return "handlenode";
152 
153  // Unary operators
154  case ISD::FABS: return "fabs";
155  case ISD::FMINNUM: return "fminnum";
156  case ISD::FMAXNUM: return "fmaxnum";
157  case ISD::FMINNAN: return "fminnan";
158  case ISD::FMAXNAN: return "fmaxnan";
159  case ISD::FNEG: return "fneg";
160  case ISD::FSQRT: return "fsqrt";
161  case ISD::FSIN: return "fsin";
162  case ISD::FCOS: return "fcos";
163  case ISD::FSINCOS: return "fsincos";
164  case ISD::FTRUNC: return "ftrunc";
165  case ISD::FFLOOR: return "ffloor";
166  case ISD::FCEIL: return "fceil";
167  case ISD::FRINT: return "frint";
168  case ISD::FNEARBYINT: return "fnearbyint";
169  case ISD::FROUND: return "fround";
170  case ISD::FEXP: return "fexp";
171  case ISD::FEXP2: return "fexp2";
172  case ISD::FLOG: return "flog";
173  case ISD::FLOG2: return "flog2";
174  case ISD::FLOG10: return "flog10";
175 
176  // Binary operators
177  case ISD::ADD: return "add";
178  case ISD::SUB: return "sub";
179  case ISD::MUL: return "mul";
180  case ISD::MULHU: return "mulhu";
181  case ISD::MULHS: return "mulhs";
182  case ISD::SDIV: return "sdiv";
183  case ISD::UDIV: return "udiv";
184  case ISD::SREM: return "srem";
185  case ISD::UREM: return "urem";
186  case ISD::SMUL_LOHI: return "smul_lohi";
187  case ISD::UMUL_LOHI: return "umul_lohi";
188  case ISD::SDIVREM: return "sdivrem";
189  case ISD::UDIVREM: return "udivrem";
190  case ISD::AND: return "and";
191  case ISD::OR: return "or";
192  case ISD::XOR: return "xor";
193  case ISD::SHL: return "shl";
194  case ISD::SRA: return "sra";
195  case ISD::SRL: return "srl";
196  case ISD::ROTL: return "rotl";
197  case ISD::ROTR: return "rotr";
198  case ISD::FADD: return "fadd";
199  case ISD::FSUB: return "fsub";
200  case ISD::FMUL: return "fmul";
201  case ISD::FDIV: return "fdiv";
202  case ISD::FMA: return "fma";
203  case ISD::FMAD: return "fmad";
204  case ISD::FREM: return "frem";
205  case ISD::FCOPYSIGN: return "fcopysign";
206  case ISD::FGETSIGN: return "fgetsign";
207  case ISD::FCANONICALIZE: return "fcanonicalize";
208  case ISD::FPOW: return "fpow";
209  case ISD::SMIN: return "smin";
210  case ISD::SMAX: return "smax";
211  case ISD::UMIN: return "umin";
212  case ISD::UMAX: return "umax";
213 
214  case ISD::FPOWI: return "fpowi";
215  case ISD::SETCC: return "setcc";
216  case ISD::SETCCE: return "setcce";
217  case ISD::SETCCCARRY: return "setcccarry";
218  case ISD::SELECT: return "select";
219  case ISD::VSELECT: return "vselect";
220  case ISD::SELECT_CC: return "select_cc";
221  case ISD::INSERT_VECTOR_ELT: return "insert_vector_elt";
222  case ISD::EXTRACT_VECTOR_ELT: return "extract_vector_elt";
223  case ISD::CONCAT_VECTORS: return "concat_vectors";
224  case ISD::INSERT_SUBVECTOR: return "insert_subvector";
225  case ISD::EXTRACT_SUBVECTOR: return "extract_subvector";
226  case ISD::SCALAR_TO_VECTOR: return "scalar_to_vector";
227  case ISD::VECTOR_SHUFFLE: return "vector_shuffle";
228  case ISD::CARRY_FALSE: return "carry_false";
229  case ISD::ADDC: return "addc";
230  case ISD::ADDE: return "adde";
231  case ISD::ADDCARRY: return "addcarry";
232  case ISD::SADDO: return "saddo";
233  case ISD::UADDO: return "uaddo";
234  case ISD::SSUBO: return "ssubo";
235  case ISD::USUBO: return "usubo";
236  case ISD::SMULO: return "smulo";
237  case ISD::UMULO: return "umulo";
238  case ISD::SUBC: return "subc";
239  case ISD::SUBE: return "sube";
240  case ISD::SUBCARRY: return "subcarry";
241  case ISD::SHL_PARTS: return "shl_parts";
242  case ISD::SRA_PARTS: return "sra_parts";
243  case ISD::SRL_PARTS: return "srl_parts";
244 
245  // Conversion operators.
246  case ISD::SIGN_EXTEND: return "sign_extend";
247  case ISD::ZERO_EXTEND: return "zero_extend";
248  case ISD::ANY_EXTEND: return "any_extend";
249  case ISD::SIGN_EXTEND_INREG: return "sign_extend_inreg";
250  case ISD::ANY_EXTEND_VECTOR_INREG: return "any_extend_vector_inreg";
251  case ISD::SIGN_EXTEND_VECTOR_INREG: return "sign_extend_vector_inreg";
252  case ISD::ZERO_EXTEND_VECTOR_INREG: return "zero_extend_vector_inreg";
253  case ISD::TRUNCATE: return "truncate";
254  case ISD::FP_ROUND: return "fp_round";
255  case ISD::FLT_ROUNDS_: return "flt_rounds";
256  case ISD::FP_ROUND_INREG: return "fp_round_inreg";
257  case ISD::FP_EXTEND: return "fp_extend";
258 
259  case ISD::SINT_TO_FP: return "sint_to_fp";
260  case ISD::UINT_TO_FP: return "uint_to_fp";
261  case ISD::FP_TO_SINT: return "fp_to_sint";
262  case ISD::FP_TO_UINT: return "fp_to_uint";
263  case ISD::BITCAST: return "bitcast";
264  case ISD::ADDRSPACECAST: return "addrspacecast";
265  case ISD::FP16_TO_FP: return "fp16_to_fp";
266  case ISD::FP_TO_FP16: return "fp_to_fp16";
267 
268  // Control flow instructions
269  case ISD::BR: return "br";
270  case ISD::BRIND: return "brind";
271  case ISD::BR_JT: return "br_jt";
272  case ISD::BRCOND: return "brcond";
273  case ISD::BR_CC: return "br_cc";
274  case ISD::CALLSEQ_START: return "callseq_start";
275  case ISD::CALLSEQ_END: return "callseq_end";
276 
277  // EH instructions
278  case ISD::CATCHRET: return "catchret";
279  case ISD::CLEANUPRET: return "cleanupret";
280 
281  // Other operators
282  case ISD::LOAD: return "load";
283  case ISD::STORE: return "store";
284  case ISD::MLOAD: return "masked_load";
285  case ISD::MSTORE: return "masked_store";
286  case ISD::MGATHER: return "masked_gather";
287  case ISD::MSCATTER: return "masked_scatter";
288  case ISD::VAARG: return "vaarg";
289  case ISD::VACOPY: return "vacopy";
290  case ISD::VAEND: return "vaend";
291  case ISD::VASTART: return "vastart";
292  case ISD::DYNAMIC_STACKALLOC: return "dynamic_stackalloc";
293  case ISD::EXTRACT_ELEMENT: return "extract_element";
294  case ISD::BUILD_PAIR: return "build_pair";
295  case ISD::STACKSAVE: return "stacksave";
296  case ISD::STACKRESTORE: return "stackrestore";
297  case ISD::TRAP: return "trap";
298  case ISD::DEBUGTRAP: return "debugtrap";
299  case ISD::LIFETIME_START: return "lifetime.start";
300  case ISD::LIFETIME_END: return "lifetime.end";
301  case ISD::GC_TRANSITION_START: return "gc_transition.start";
302  case ISD::GC_TRANSITION_END: return "gc_transition.end";
303  case ISD::GET_DYNAMIC_AREA_OFFSET: return "get.dynamic.area.offset";
304 
305  // Bit manipulation
306  case ISD::ABS: return "abs";
307  case ISD::BITREVERSE: return "bitreverse";
308  case ISD::BSWAP: return "bswap";
309  case ISD::CTPOP: return "ctpop";
310  case ISD::CTTZ: return "cttz";
311  case ISD::CTTZ_ZERO_UNDEF: return "cttz_zero_undef";
312  case ISD::CTLZ: return "ctlz";
313  case ISD::CTLZ_ZERO_UNDEF: return "ctlz_zero_undef";
314 
315  // Trampolines
316  case ISD::INIT_TRAMPOLINE: return "init_trampoline";
317  case ISD::ADJUST_TRAMPOLINE: return "adjust_trampoline";
318 
319  case ISD::CONDCODE:
320  switch (cast<CondCodeSDNode>(this)->get()) {
321  default: llvm_unreachable("Unknown setcc condition!");
322  case ISD::SETOEQ: return "setoeq";
323  case ISD::SETOGT: return "setogt";
324  case ISD::SETOGE: return "setoge";
325  case ISD::SETOLT: return "setolt";
326  case ISD::SETOLE: return "setole";
327  case ISD::SETONE: return "setone";
328 
329  case ISD::SETO: return "seto";
330  case ISD::SETUO: return "setuo";
331  case ISD::SETUEQ: return "setueq";
332  case ISD::SETUGT: return "setugt";
333  case ISD::SETUGE: return "setuge";
334  case ISD::SETULT: return "setult";
335  case ISD::SETULE: return "setule";
336  case ISD::SETUNE: return "setune";
337 
338  case ISD::SETEQ: return "seteq";
339  case ISD::SETGT: return "setgt";
340  case ISD::SETGE: return "setge";
341  case ISD::SETLT: return "setlt";
342  case ISD::SETLE: return "setle";
343  case ISD::SETNE: return "setne";
344 
345  case ISD::SETTRUE: return "settrue";
346  case ISD::SETTRUE2: return "settrue2";
347  case ISD::SETFALSE: return "setfalse";
348  case ISD::SETFALSE2: return "setfalse2";
349  }
350  case ISD::VECREDUCE_FADD: return "vecreduce_fadd";
351  case ISD::VECREDUCE_FMUL: return "vecreduce_fmul";
352  case ISD::VECREDUCE_ADD: return "vecreduce_add";
353  case ISD::VECREDUCE_MUL: return "vecreduce_mul";
354  case ISD::VECREDUCE_AND: return "vecreduce_and";
355  case ISD::VECREDUCE_OR: return "vecreduce_or";
356  case ISD::VECREDUCE_XOR: return "vecreduce_xor";
357  case ISD::VECREDUCE_SMAX: return "vecreduce_smax";
358  case ISD::VECREDUCE_SMIN: return "vecreduce_smin";
359  case ISD::VECREDUCE_UMAX: return "vecreduce_umax";
360  case ISD::VECREDUCE_UMIN: return "vecreduce_umin";
361  case ISD::VECREDUCE_FMAX: return "vecreduce_fmax";
362  case ISD::VECREDUCE_FMIN: return "vecreduce_fmin";
363  }
364 }
365 
367  switch (AM) {
368  default: return "";
369  case ISD::PRE_INC: return "<pre-inc>";
370  case ISD::PRE_DEC: return "<pre-dec>";
371  case ISD::POST_INC: return "<post-inc>";
372  case ISD::POST_DEC: return "<post-dec>";
373  }
374 }
375 
376 static Printable PrintNodeId(const SDNode &Node) {
377  return Printable([&Node](raw_ostream &OS) {
378 #ifndef NDEBUG
379  OS << 't' << Node.PersistentId;
380 #else
381  OS << (const void*)&Node;
382 #endif
383  });
384 }
385 
386 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
387 LLVM_DUMP_METHOD void SDNode::dump() const { dump(nullptr); }
389  print(dbgs(), G);
390  dbgs() << '\n';
391 }
392 #endif
393 
395  for (unsigned i = 0, e = getNumValues(); i != e; ++i) {
396  if (i) OS << ",";
397  if (getValueType(i) == MVT::Other)
398  OS << "ch";
399  else
400  OS << getValueType(i).getEVTString();
401  }
402 }
403 
405  if (const MachineSDNode *MN = dyn_cast<MachineSDNode>(this)) {
406  if (!MN->memoperands_empty()) {
407  OS << "<";
408  OS << "Mem:";
409  for (MachineSDNode::mmo_iterator i = MN->memoperands_begin(),
410  e = MN->memoperands_end(); i != e; ++i) {
411  OS << **i;
412  if (std::next(i) != e)
413  OS << " ";
414  }
415  OS << ">";
416  }
417  } else if (const ShuffleVectorSDNode *SVN =
418  dyn_cast<ShuffleVectorSDNode>(this)) {
419  OS << "<";
420  for (unsigned i = 0, e = ValueList[0].getVectorNumElements(); i != e; ++i) {
421  int Idx = SVN->getMaskElt(i);
422  if (i) OS << ",";
423  if (Idx < 0)
424  OS << "u";
425  else
426  OS << Idx;
427  }
428  OS << ">";
429  } else if (const ConstantSDNode *CSDN = dyn_cast<ConstantSDNode>(this)) {
430  OS << '<' << CSDN->getAPIntValue() << '>';
431  } else if (const ConstantFPSDNode *CSDN = dyn_cast<ConstantFPSDNode>(this)) {
432  if (&CSDN->getValueAPF().getSemantics()==&APFloat::IEEEsingle())
433  OS << '<' << CSDN->getValueAPF().convertToFloat() << '>';
434  else if (&CSDN->getValueAPF().getSemantics()==&APFloat::IEEEdouble())
435  OS << '<' << CSDN->getValueAPF().convertToDouble() << '>';
436  else {
437  OS << "<APFloat(";
438  CSDN->getValueAPF().bitcastToAPInt().print(OS, false);
439  OS << ")>";
440  }
441  } else if (const GlobalAddressSDNode *GADN =
442  dyn_cast<GlobalAddressSDNode>(this)) {
443  int64_t offset = GADN->getOffset();
444  OS << '<';
445  GADN->getGlobal()->printAsOperand(OS);
446  OS << '>';
447  if (offset > 0)
448  OS << " + " << offset;
449  else
450  OS << " " << offset;
451  if (unsigned int TF = GADN->getTargetFlags())
452  OS << " [TF=" << TF << ']';
453  } else if (const FrameIndexSDNode *FIDN = dyn_cast<FrameIndexSDNode>(this)) {
454  OS << "<" << FIDN->getIndex() << ">";
455  } else if (const JumpTableSDNode *JTDN = dyn_cast<JumpTableSDNode>(this)) {
456  OS << "<" << JTDN->getIndex() << ">";
457  if (unsigned int TF = JTDN->getTargetFlags())
458  OS << " [TF=" << TF << ']';
459  } else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(this)){
460  int offset = CP->getOffset();
461  if (CP->isMachineConstantPoolEntry())
462  OS << "<" << *CP->getMachineCPVal() << ">";
463  else
464  OS << "<" << *CP->getConstVal() << ">";
465  if (offset > 0)
466  OS << " + " << offset;
467  else
468  OS << " " << offset;
469  if (unsigned int TF = CP->getTargetFlags())
470  OS << " [TF=" << TF << ']';
471  } else if (const TargetIndexSDNode *TI = dyn_cast<TargetIndexSDNode>(this)) {
472  OS << "<" << TI->getIndex() << '+' << TI->getOffset() << ">";
473  if (unsigned TF = TI->getTargetFlags())
474  OS << " [TF=" << TF << ']';
475  } else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(this)) {
476  OS << "<";
477  const Value *LBB = (const Value*)BBDN->getBasicBlock()->getBasicBlock();
478  if (LBB)
479  OS << LBB->getName() << " ";
480  OS << (const void*)BBDN->getBasicBlock() << ">";
481  } else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(this)) {
482  OS << ' ' << PrintReg(R->getReg(),
483  G ? G->getSubtarget().getRegisterInfo() : nullptr);
484  } else if (const ExternalSymbolSDNode *ES =
485  dyn_cast<ExternalSymbolSDNode>(this)) {
486  OS << "'" << ES->getSymbol() << "'";
487  if (unsigned int TF = ES->getTargetFlags())
488  OS << " [TF=" << TF << ']';
489  } else if (const SrcValueSDNode *M = dyn_cast<SrcValueSDNode>(this)) {
490  if (M->getValue())
491  OS << "<" << M->getValue() << ">";
492  else
493  OS << "<null>";
494  } else if (const MDNodeSDNode *MD = dyn_cast<MDNodeSDNode>(this)) {
495  if (MD->getMD())
496  OS << "<" << MD->getMD() << ">";
497  else
498  OS << "<null>";
499  } else if (const VTSDNode *N = dyn_cast<VTSDNode>(this)) {
500  OS << ":" << N->getVT().getEVTString();
501  }
502  else if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(this)) {
503  OS << "<" << *LD->getMemOperand();
504 
505  bool doExt = true;
506  switch (LD->getExtensionType()) {
507  default: doExt = false; break;
508  case ISD::EXTLOAD: OS << ", anyext"; break;
509  case ISD::SEXTLOAD: OS << ", sext"; break;
510  case ISD::ZEXTLOAD: OS << ", zext"; break;
511  }
512  if (doExt)
513  OS << " from " << LD->getMemoryVT().getEVTString();
514 
515  const char *AM = getIndexedModeName(LD->getAddressingMode());
516  if (*AM)
517  OS << ", " << AM;
518 
519  OS << ">";
520  } else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(this)) {
521  OS << "<" << *ST->getMemOperand();
522 
523  if (ST->isTruncatingStore())
524  OS << ", trunc to " << ST->getMemoryVT().getEVTString();
525 
526  const char *AM = getIndexedModeName(ST->getAddressingMode());
527  if (*AM)
528  OS << ", " << AM;
529 
530  OS << ">";
531  } else if (const MemSDNode* M = dyn_cast<MemSDNode>(this)) {
532  OS << "<" << *M->getMemOperand() << ">";
533  } else if (const BlockAddressSDNode *BA =
534  dyn_cast<BlockAddressSDNode>(this)) {
535  int64_t offset = BA->getOffset();
536  OS << "<";
537  BA->getBlockAddress()->getFunction()->printAsOperand(OS, false);
538  OS << ", ";
539  BA->getBlockAddress()->getBasicBlock()->printAsOperand(OS, false);
540  OS << ">";
541  if (offset > 0)
542  OS << " + " << offset;
543  else
544  OS << " " << offset;
545  if (unsigned int TF = BA->getTargetFlags())
546  OS << " [TF=" << TF << ']';
547  } else if (const AddrSpaceCastSDNode *ASC =
548  dyn_cast<AddrSpaceCastSDNode>(this)) {
549  OS << '['
550  << ASC->getSrcAddressSpace()
551  << " -> "
552  << ASC->getDestAddressSpace()
553  << ']';
554  }
555 
556  if (VerboseDAGDumping) {
557  if (unsigned Order = getIROrder())
558  OS << " [ORD=" << Order << ']';
559 
560  if (getNodeId() != -1)
561  OS << " [ID=" << getNodeId() << ']';
562 
563  if (!G)
564  return;
565 
566  DILocation *L = getDebugLoc();
567  if (!L)
568  return;
569 
570  if (auto *Scope = L->getScope())
571  OS << Scope->getFilename();
572  else
573  OS << "<unknown>";
574  OS << ':' << L->getLine();
575  if (unsigned C = L->getColumn())
576  OS << ':' << C;
577  }
578 }
579 
580 /// Return true if this node is so simple that we should just print it inline
581 /// if it appears as an operand.
582 static bool shouldPrintInline(const SDNode &Node) {
583  if (Node.getOpcode() == ISD::EntryToken)
584  return false;
585  return Node.getNumOperands() == 0;
586 }
587 
588 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
589 static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) {
590  for (const SDValue &Op : N->op_values()) {
591  if (shouldPrintInline(*Op.getNode()))
592  continue;
593  if (Op.getNode()->hasOneUse())
594  DumpNodes(Op.getNode(), indent+2, G);
595  }
596 
597  dbgs().indent(indent);
598  N->dump(G);
599 }
600 
601 LLVM_DUMP_METHOD void SelectionDAG::dump() const {
602  dbgs() << "SelectionDAG has " << AllNodes.size() << " nodes:\n";
603 
604  for (allnodes_const_iterator I = allnodes_begin(), E = allnodes_end();
605  I != E; ++I) {
606  const SDNode *N = &*I;
607  if (!N->hasOneUse() && N != getRoot().getNode() &&
608  (!shouldPrintInline(*N) || N->use_empty()))
609  DumpNodes(N, 2, this);
610  }
611 
612  if (getRoot().getNode()) DumpNodes(getRoot().getNode(), 2, this);
613  dbgs() << "\n\n";
614 }
615 #endif
616 
617 void SDNode::printr(raw_ostream &OS, const SelectionDAG *G) const {
618  OS << PrintNodeId(*this) << ": ";
619  print_types(OS, G);
620  OS << " = " << getOperationName(G);
621  print_details(OS, G);
622 }
623 
624 static bool printOperand(raw_ostream &OS, const SelectionDAG *G,
625  const SDValue Value) {
626  if (!Value.getNode()) {
627  OS << "<null>";
628  return false;
629  } else if (shouldPrintInline(*Value.getNode())) {
630  OS << Value->getOperationName(G) << ':';
631  Value->print_types(OS, G);
632  Value->print_details(OS, G);
633  return true;
634  } else {
635  OS << PrintNodeId(*Value.getNode());
636  if (unsigned RN = Value.getResNo())
637  OS << ':' << RN;
638  return false;
639  }
640 }
641 
642 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
643 typedef SmallPtrSet<const SDNode *, 32> VisitedSDNodeSet;
644 static void DumpNodesr(raw_ostream &OS, const SDNode *N, unsigned indent,
645  const SelectionDAG *G, VisitedSDNodeSet &once) {
646  if (!once.insert(N).second) // If we've been here before, return now.
647  return;
648 
649  // Dump the current SDNode, but don't end the line yet.
650  OS.indent(indent);
651  N->printr(OS, G);
652 
653  // Having printed this SDNode, walk the children:
654  for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
655  if (i) OS << ",";
656  OS << " ";
657 
658  const SDValue Op = N->getOperand(i);
659  bool printedInline = printOperand(OS, G, Op);
660  if (printedInline)
661  once.insert(Op.getNode());
662  }
663 
664  OS << "\n";
665 
666  // Dump children that have grandchildren on their own line(s).
667  for (const SDValue &Op : N->op_values())
668  DumpNodesr(OS, Op.getNode(), indent+2, G, once);
669 }
670 
672  VisitedSDNodeSet once;
673  DumpNodesr(dbgs(), this, 0, nullptr, once);
674 }
675 
677  VisitedSDNodeSet once;
678  DumpNodesr(dbgs(), this, 0, G, once);
679 }
680 #endif
681 
682 static void printrWithDepthHelper(raw_ostream &OS, const SDNode *N,
683  const SelectionDAG *G, unsigned depth,
684  unsigned indent) {
685  if (depth == 0)
686  return;
687 
688  OS.indent(indent);
689 
690  N->print(OS, G);
691 
692  if (depth < 1)
693  return;
694 
695  for (const SDValue &Op : N->op_values()) {
696  // Don't follow chain operands.
697  if (Op.getValueType() == MVT::Other)
698  continue;
699  OS << '\n';
700  printrWithDepthHelper(OS, Op.getNode(), G, depth-1, indent+2);
701  }
702 }
703 
705  unsigned depth) const {
706  printrWithDepthHelper(OS, this, G, depth, 0);
707 }
708 
709 void SDNode::printrFull(raw_ostream &OS, const SelectionDAG *G) const {
710  // Don't print impossibly deep things.
711  printrWithDepth(OS, G, 10);
712 }
713 
714 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
716 void SDNode::dumprWithDepth(const SelectionDAG *G, unsigned depth) const {
717  printrWithDepth(dbgs(), G, depth);
718 }
719 
721  // Don't print impossibly deep things.
722  dumprWithDepth(G, 10);
723 }
724 #endif
725 
726 void SDNode::print(raw_ostream &OS, const SelectionDAG *G) const {
727  printr(OS, G);
728  for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
729  if (i) OS << ", "; else OS << " ";
730  printOperand(OS, G, getOperand(i));
731  }
732 }
ADJUST_TRAMPOLINE - This corresponds to the adjust_trampoline intrinsic.
Definition: ISDOpcodes.h:724
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
Definition: ISDOpcodes.h:544
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
Definition: ISDOpcodes.h:511
BUILTIN_OP_END - This must be the last enum value in this list.
Definition: ISDOpcodes.h:827
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
Definition: ISDOpcodes.h:568
EXTRACT_ELEMENT - This is used to get the lower or upper (determined by a Constant, which is required to be operand #1) half of the integer or float value specified as operand #0.
Definition: ISDOpcodes.h:184
DELETED_NODE - This is an illegal value that is used to catch errors.
Definition: ISDOpcodes.h:42
MDNODE_SDNODE - This is a node that holdes an MDNode*, which is used to reference metadata in the IR...
Definition: ISDOpcodes.h:696
EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an vector value) starting with the ...
Definition: ISDOpcodes.h:332
BR_CC - Conditional branch.
Definition: ISDOpcodes.h:616
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
Definition: Compiler.h:449
Various leaf nodes.
Definition: ISDOpcodes.h:60
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
Definition: ISDOpcodes.h:341
ZERO_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register zero-extension of the low ...
Definition: ISDOpcodes.h:493
Carry-setting nodes for multiple precision addition and subtraction.
Definition: ISDOpcodes.h:222
const TargetMachine & getTarget() const
Definition: SelectionDAG.h:377
const TargetSubtargetInfo & getSubtarget() const
Definition: SelectionDAG.h:378
STACKRESTORE has two operands, an input chain and a pointer to restore to it returns an output chain...
Definition: ISDOpcodes.h:659
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
Definition: ISDOpcodes.h:250
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or anything else with this node...
Definition: ISDOpcodes.h:131
Val, Success, OUTCHAIN = ATOMIC_CMP_SWAP_WITH_SUCCESS(INCHAIN, ptr, cmp, swap) N.b.
Definition: ISDOpcodes.h:762
unsigned getNumOperands() const
Return the number of values used by this operation.
const SDValue & getOperand(unsigned Num) const
SIGN_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register sign-extension of the low ...
Definition: ISDOpcodes.h:484
[US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned integers.
Definition: ISDOpcodes.h:358
Same for subtraction.
Definition: ISDOpcodes.h:253
INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2 inserted into VECTOR1 at the ...
Definition: ISDOpcodes.h:327
void dumprWithDepth(const SelectionDAG *G=nullptr, unsigned depth=100) const
printrWithDepth to dbgs().
uint16_t PersistentId
Unique and persistent id per SDNode in the DAG.
The address of the GOT.
Definition: ISDOpcodes.h:66
EntryToken - This is the marker used to indicate the start of a region.
Definition: ISDOpcodes.h:45
OUTCHAIN = ATOMIC_FENCE(INCHAIN, ordering, scope) This corresponds to the fence instruction.
Definition: ISDOpcodes.h:741
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
Definition: ISDOpcodes.h:403
INT = FGETSIGN(FP) - Return the sign bit of the specified floating point value as an integer 0/1 valu...
Definition: ISDOpcodes.h:290
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
Definition: ISDOpcodes.h:159
OUTCHAIN = EH_SJLJ_LONGJMP(INCHAIN, buffer) This corresponds to the eh.sjlj.longjmp intrinsic...
Definition: ISDOpcodes.h:114
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
Definition: ISDOpcodes.h:209
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
Definition: ISDOpcodes.h:432
void print_types(raw_ostream &OS, const SelectionDAG *G) const
CLEANUPRET - Represents a return from a cleanup block funclet.
Definition: ISDOpcodes.h:650
static Printable PrintNodeId(const SDNode &Node)
A description of a memory reference used in the backend.
virtual const char * getTargetNodeName(unsigned Opcode) const
This method returns the name of a target specific DAG node.
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
Definition: ValueTypes.cpp:120
PCMARKER - This corresponds to the pcmarker intrinsic.
Definition: ISDOpcodes.h:699
StringRef getName(ID id)
Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
Definition: Function.cpp:591
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
const HexagonInstrInfo * TII
Shift and rotation operations.
Definition: ISDOpcodes.h:378
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
ABS - Determine the unsigned absolute value of a signed integer value of the same bitwidth...
Definition: ISDOpcodes.h:367
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
Definition: ISDOpcodes.h:190
CopyToReg - This node has three operands: a chain, a register number to set to this value...
Definition: ISDOpcodes.h:170
FLT_ROUNDS_ - Returns current rounding mode: -1 Undefined 0 Round to 0 1 Round to nearest 2 Round to ...
Definition: ISDOpcodes.h:519
CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end of a call sequence, and carry arbitrary information that target might want to know.
Definition: ISDOpcodes.h:673
EH_DWARF_CFA - This node represents the pointer to the DWARF Canonical Frame Address (CFA)...
Definition: ISDOpcodes.h:96
Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt) Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amt) For double-word atomic operations: ValLo, ValHi, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amtLo, amtHi) ValLo, ValHi, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amtLo, amtHi) These correspond to the atomicrmw instruction.
Definition: ISDOpcodes.h:770
FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and llvm.returnaddress on the DAG...
Definition: ISDOpcodes.h:73
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
static void printrWithDepthHelper(raw_ostream &OS, const SDNode *N, const SelectionDAG *G, unsigned depth, unsigned indent)
INLINEASM - Represents an inline asm block.
Definition: ISDOpcodes.h:633
STACKSAVE - STACKSAVE has one operand, an input chain.
Definition: ISDOpcodes.h:655
FRAME_TO_ARGS_OFFSET - This node represents offset from frame pointer to first (possible) on-stack ar...
Definition: ISDOpcodes.h:91
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
Definition: ISDOpcodes.h:454
OUTCHAIN = EH_SJLJ_SETUP_DISPATCH(INCHAIN) The target initializes the dispatch table here...
Definition: ISDOpcodes.h:118
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
Definition: ISDOpcodes.h:397
Simple integer binary arithmetic operators.
Definition: ISDOpcodes.h:200
static std::string utostr(uint64_t X, bool isNeg=false)
Definition: StringExtras.h:160
static void DumpNodesr(raw_ostream &OS, const SDNode *N, unsigned indent, const SelectionDAG *G, VisitedSDNodeSet &once)
static const fltSemantics & IEEEdouble() LLVM_READNONE
Definition: APFloat.cpp:122
TargetConstant* - Like Constant*, but the DAG does not do any folding, simplification, or lowering of the constant.
Definition: ISDOpcodes.h:125
static const char * getIndexedModeName(ISD::MemIndexedMode AM)
READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
Definition: ISDOpcodes.h:707
ANY_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register any-extension of the low la...
Definition: ISDOpcodes.h:471
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
Definition: ISDOpcodes.h:151
const char * Name
UNDEF - An undefined node.
Definition: ISDOpcodes.h:178
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
Definition: ISDOpcodes.h:497
std::string getOperationName(const SelectionDAG *G=nullptr) const
Return the opcode of this operation for printing.
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
Definition: ISDOpcodes.h:301
TargetInstrInfo - Interface to description of machine instruction set.
This corresponds to the llvm.lifetime.
Definition: ISDOpcodes.h:794
SDNode * getNode() const
get the SDNode which holds the desired result
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
Definition: ISDOpcodes.h:166
These reductions are non-strict, and have a single vector operand.
Definition: ISDOpcodes.h:818
Control flow instructions. These all have token chains.
Definition: ISDOpcodes.h:595
READ_REGISTER, WRITE_REGISTER - This node represents llvm.register on the DAG, which implements the n...
Definition: ISDOpcodes.h:85
GC_TRANSITION_START/GC_TRANSITION_END - These operators mark the beginning and end of GC transition s...
Definition: ISDOpcodes.h:802
LOCAL_RECOVER - Represents the llvm.localrecover intrinsic.
Definition: ISDOpcodes.h:81
Simple binary floating point operators.
Definition: ISDOpcodes.h:259
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
Definition: ISDOpcodes.h:688
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL...
Definition: ISDOpcodes.h:306
Carry-using nodes for multiple precision addition and subtraction.
Definition: ISDOpcodes.h:231
static sys::TimePoint< std::chrono::seconds > now(bool Deterministic)
INIT_TRAMPOLINE - This corresponds to the init_trampoline intrinsic.
Definition: ISDOpcodes.h:718
void printrFull(raw_ostream &O, const SelectionDAG *G=nullptr) const
Print a SelectionDAG node and all children down to the leaves.
TRAP - Trapping instruction.
Definition: ISDOpcodes.h:727
TargetIndex - Like a constant pool entry, but with completely target-dependent semantics.
Definition: ISDOpcodes.h:144
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
Definition: ISDOpcodes.h:57
DEBUGTRAP - Trap intended to get the attention of a debugger.
Definition: ISDOpcodes.h:730
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
Definition: ISDOpcodes.h:679
Bit counting operators with an undefined result for zero inputs.
Definition: ISDOpcodes.h:384
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo...
Definition: ISDOpcodes.h:756
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
Definition: ISDOpcodes.h:529
HANDLENODE node - Used as a handle for various purposes.
Definition: ISDOpcodes.h:710
EH_LABEL - Represents a label in mid basic block used to track locations needed for debug and excepti...
Definition: ISDOpcodes.h:638
void print(raw_ostream &OS, const SelectionDAG *G=nullptr) const
TargetIntrinsicInfo - Interface to description of machine instruction set.
TokenFactor - This node takes multiple tokens as input and produces a single token result...
Definition: ISDOpcodes.h:50
static const fltSemantics & IEEEsingle() LLVM_READNONE
Definition: APFloat.cpp:119
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
Definition: SmallPtrSet.h:423
void dump() const
Dump this node, for debugging.
Returns platform specific canonical encoding of a floating point number.
Definition: ISDOpcodes.h:293
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
Definition: ISDOpcodes.h:313
Like SetCC, ops #0 and #1 are the LHS and RHS operands to compare, but op #2 is a boolean indicating ...
Definition: ISDOpcodes.h:427
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
Definition: SelectionDAG.h:209
X = FP_ROUND_INREG(Y, VT) - This operator takes an FP register, and rounds it to a floating point val...
Definition: ISDOpcodes.h:526
ADDRSPACECAST - This operator converts between pointers of different address spaces.
Definition: ISDOpcodes.h:548
BRCOND - Conditional branch.
Definition: ISDOpcodes.h:610
const DataFlowGraph & G
Definition: RDFGraph.cpp:206
An SDNode that represents everything that will be needed to construct a MachineInstr.
Byte Swap and Counting operators.
Definition: ISDOpcodes.h:381
const size_t N
FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions and truncation for half-preci...
Definition: ISDOpcodes.h:554
Represents one node in the SelectionDAG.
void print_details(raw_ostream &OS, const SelectionDAG *G) const
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:132
void printr(raw_ostream &OS, const SelectionDAG *G=nullptr) const
Select(COND, TRUEVAL, FALSEVAL).
Definition: ISDOpcodes.h:388
ZERO_EXTEND - Used for integer types, zeroing the new bits.
Definition: ISDOpcodes.h:444
ANY_EXTEND - Used for integer types. The high bits are undefined.
Definition: ISDOpcodes.h:447
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
Definition: ISDOpcodes.h:286
FMINNAN/FMAXNAN - Behave identically to FMINNUM/FMAXNUM, except that when a single input is NaN...
Definition: ISDOpcodes.h:571
iterator_range< value_op_iterator > op_values() const
CATCHRET - Represents a return from a catch block funclet.
Definition: ISDOpcodes.h:646
llvm_unreachable("Unknown RegBank!")
GET_DYNAMIC_AREA_OFFSET - get offset from native SP to the address of the most recent dynamic alloca...
Definition: ISDOpcodes.h:809
BR_JT - Jumptable branch.
Definition: ISDOpcodes.h:604
VACOPY - VACOPY has 5 operands: an input chain, a destination pointer, a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the source.
Definition: ISDOpcodes.h:684
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
Bitwise operators - logical and, logical or, logical xor.
Definition: ISDOpcodes.h:361
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
Definition: ISDOpcodes.h:205
virtual const TargetIntrinsicInfo * getIntrinsicInfo() const
If intrinsic information is available, return it. If not, return null.
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
Definition: ISDOpcodes.h:462
void dumprFull(const SelectionDAG *G=nullptr) const
printrFull to dbgs().
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
Definition: ISDOpcodes.h:580
Same for multiplication.
Definition: ISDOpcodes.h:256
FSINCOS - Compute both fsin and fcos as a single operation.
Definition: ISDOpcodes.h:574
RESULT, OUTCHAIN = EH_SJLJ_SETJMP(INCHAIN, buffer) This corresponds to the eh.sjlj.setjmp intrinsic.
Definition: ISDOpcodes.h:108
CopyFromReg - This node indicates that the input value is a virtual or physical register that is defi...
Definition: ISDOpcodes.h:175
OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents 'eh_return' gcc dwarf builtin...
Definition: ISDOpcodes.h:102
Like SetCC, ops #0 and #1 are the LHS and RHS operands to compare, and op #2 is a carry value...
Definition: ISDOpcodes.h:420
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
Definition: ISDOpcodes.h:319
virtual const TargetInstrInfo * getInstrInfo() const
FMA - Perform a * b + c with no intermediate rounding step.
Definition: ISDOpcodes.h:276
FMIN/FMAX nodes can have flags, for NaN/NoNaN variants.
Definition: ISDOpcodes.h:823
PREFETCH - This corresponds to a prefetch intrinsic.
Definition: ISDOpcodes.h:736
void printrWithDepth(raw_ostream &O, const SelectionDAG *G=nullptr, unsigned depth=100) const
Print a SelectionDAG node and children up to depth "depth." The given SelectionDAG allows target-spec...
const TargetLowering & getTargetLoweringInfo() const
Definition: SelectionDAG.h:379
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
FMAD - Perform a * b + c, while getting the same result as the separately rounded operations...
Definition: ISDOpcodes.h:280
SetCC operator - This evaluates to a true value iff the condition is true.
Definition: ISDOpcodes.h:411
void dumpr() const
Dump (recursively) this node and its use-def subgraph.
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
Definition: ISDOpcodes.h:197
Conversion operators.
Definition: ISDOpcodes.h:441
Simple wrapper around std::function<void(raw_ostream&)>.
Definition: Printable.h:38
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
Definition: ISDOpcodes.h:749
TRUNCATE - Completely drop the high bits.
Definition: ISDOpcodes.h:450
static cl::opt< bool > VerboseDAGDumping("dag-dump-verbose", cl::Hidden, cl::desc("Display more information when dumping selection ""DAG nodes."))
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW, FLOG, FLOG2, FLOG10, FEXP, FEXP2, FCEIL, FTRUNC, FRINT, FNEARBYINT, FROUND, FFLOOR - Perform various unary floating point operations.
Definition: ISDOpcodes.h:560
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
Definition: ISDOpcodes.h:745
SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a scalar value into element 0 of the...
Definition: ISDOpcodes.h:349
Carry-using nodes for multiple precision addition and subtraction.
Definition: ISDOpcodes.h:241
CARRY_FALSE - This node is used when folding other nodes, like ADDC/SUBC, which indicate the carry re...
Definition: ISDOpcodes.h:213
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
Definition: ISDOpcodes.h:864
BRIND - Indirect branch.
Definition: ISDOpcodes.h:600
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
Definition: ISDOpcodes.h:354
SRCVALUE - This is a node type that holds a Value* that is used to make reference to a value in the L...
Definition: ISDOpcodes.h:692
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary...
Definition: ISDOpcodes.h:589