37 return "<<Unknown DAG Node>>";
48 if (Name)
return Name;
106 unsigned IID = cast<ConstantSDNode>(
getOperand(OpNo))->getZExtValue();
110 return TII->getName(IID);
232 switch (cast<CvtRndSatSDNode>(
this)->getCvtCode()) {
285 switch (cast<CondCodeSDNode>(
this)->
get()) {
335 OS << (
const void*)
this <<
": ";
348 if (
const MachineSDNode *MN = dyn_cast<MachineSDNode>(
this)) {
349 if (!MN->memoperands_empty()) {
353 e = MN->memoperands_end(); i != e; ++i) {
361 dyn_cast<ShuffleVectorSDNode>(
this)) {
363 for (
unsigned i = 0, e = ValueList[0].getVectorNumElements(); i != e; ++i) {
364 int Idx = SVN->getMaskElt(i);
372 }
else if (
const ConstantSDNode *CSDN = dyn_cast<ConstantSDNode>(
this)) {
373 OS <<
'<' << CSDN->getAPIntValue() <<
'>';
374 }
else if (
const ConstantFPSDNode *CSDN = dyn_cast<ConstantFPSDNode>(
this)) {
376 OS <<
'<' << CSDN->getValueAPF().convertToFloat() <<
'>';
378 OS <<
'<' << CSDN->getValueAPF().convertToDouble() <<
'>';
381 CSDN->getValueAPF().bitcastToAPInt().dump();
385 dyn_cast<GlobalAddressSDNode>(
this)) {
386 int64_t offset = GADN->getOffset();
391 OS << " + " << offset;
394 if (unsigned int TF = GADN->getTargetFlags())
395 OS << " [TF=" << TF << ']
';
396 } else if (const FrameIndexSDNode *FIDN = dyn_cast<FrameIndexSDNode>(this)) {
397 OS << "<" << FIDN->getIndex() << ">";
398 } else if (const JumpTableSDNode *JTDN = dyn_cast<JumpTableSDNode>(this)) {
399 OS << "<" << JTDN->getIndex() << ">";
400 if (unsigned int TF = JTDN->getTargetFlags())
401 OS << " [TF=" << TF << ']
';
402 } else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(this)){
403 int offset = CP->getOffset();
404 if (CP->isMachineConstantPoolEntry())
405 OS << "<" << *CP->getMachineCPVal() << ">";
407 OS << "<" << *CP->getConstVal() << ">";
409 OS << " + " << offset;
412 if (unsigned int TF = CP->getTargetFlags())
413 OS << " [TF=" << TF << ']
';
414 } else if (const TargetIndexSDNode *TI = dyn_cast<TargetIndexSDNode>(this)) {
415 OS << "<" << TI->getIndex() << '+
' << TI->getOffset() << ">";
416 if (unsigned TF = TI->getTargetFlags())
417 OS << " [TF=" << TF << ']
';
418 } else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(this)) {
420 const Value *LBB = (const Value*)BBDN->getBasicBlock()->getBasicBlock();
422 OS << LBB->getName() << " ";
423 OS << (const void*)BBDN->getBasicBlock() << ">";
424 } else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(this)) {
425 OS << ' ' << PrintReg(R->getReg(), G ? G->getTarget().getRegisterInfo() :0);
426 } else if (const ExternalSymbolSDNode *ES =
427 dyn_cast<ExternalSymbolSDNode>(this)) {
428 OS << "'" << ES->getSymbol() << "'";
429 if (unsigned int TF = ES->getTargetFlags())
430 OS << " [TF=" << TF << ']
';
431 } else if (const SrcValueSDNode *M = dyn_cast<SrcValueSDNode>(this)) {
433 OS << "<" << M->getValue() << ">";
436 } else if (const MDNodeSDNode *MD = dyn_cast<MDNodeSDNode>(this)) {
438 OS << "<" << MD->getMD() << ">";
441 } else if (const VTSDNode *N = dyn_cast<VTSDNode>(this)) {
442 OS << ":" << N->getVT().getEVTString();
444 else if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(this)) {
445 OS << "<" << *LD->getMemOperand();
448 switch (LD->getExtensionType()) {
449 default: doExt = false; break;
450 case ISD::EXTLOAD: OS << ", anyext"; break;
451 case ISD::SEXTLOAD: OS << ", sext"; break;
452 case ISD::ZEXTLOAD: OS << ", zext"; break;
455 OS << " from " << LD->getMemoryVT().getEVTString();
457 const char *AM = getIndexedModeName(LD->getAddressingMode());
462 } else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(this)) {
463 OS << "<" << *ST->getMemOperand();
465 if (ST->isTruncatingStore())
466 OS << ", trunc to " << ST->getMemoryVT().getEVTString();
468 const char *AM = getIndexedModeName(ST->getAddressingMode());
473 } else if (const MemSDNode* M = dyn_cast<MemSDNode>(this)) {
474 OS << "<" << *M->getMemOperand() << ">";
475 } else if (const BlockAddressSDNode *BA =
476 dyn_cast<BlockAddressSDNode>(this)) {
477 int64_t offset = BA->getOffset();
479 WriteAsOperand(OS, BA->getBlockAddress()->getFunction(), false);
481 WriteAsOperand(OS, BA->getBlockAddress()->getBasicBlock(), false);
484 OS << " + " << offset;
487 if (unsigned int TF = BA->getTargetFlags())
488 OS << " [TF=" << TF << ']
';
489 } else if (const AddrSpaceCastSDNode *ASC =
490 dyn_cast<AddrSpaceCastSDNode>(this)) {
492 << ASC->getSrcAddressSpace()
494 << ASC->getDestAddressSpace()
498 if (unsigned Order = getIROrder())
499 OS << " [ORD=" << Order << ']
';
501 if (getNodeId() != -1)
502 OS << " [ID=" << getNodeId() << ']
';
504 DebugLoc dl = getDebugLoc();
505 if (G && !dl.isUnknown()) {
507 Scope(dl.getScope(G->getMachineFunction().getFunction()->getContext()));
509 assert((!Scope || Scope.isScope()) &&
510 "Scope of a DebugLoc should be null or a DIScope.");
511 // Omit the directory, since it's usually
long and uninteresting.
513 OS << Scope.getFilename();
516 OS <<
':' << dl.getLine();
517 if (dl.getCol() != 0)
518 OS <<
':' << dl.getCol();
527 dbgs() <<
"\n" << std::string(indent+2,
' ')
536 dbgs() <<
"SelectionDAG has " << AllNodes.size() <<
" nodes:";
576 OS << (
const void*)child;
624 unsigned depth)
const {
645 if (i) OS <<
", ";
else OS <<
" ";
void dump() const
dump - Dump this node, for debugging.
static const fltSemantics IEEEdouble
static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G)
const TargetMachine & getTarget() const
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
unsigned getOpcode() const
unsigned getNumOperands() const
const SDValue & getOperand(unsigned Num) const
SmallPtrSet< const SDNode *, 128 > VisitedSDNodeSet
void printrFull(raw_ostream &O, const SelectionDAG *G=0) const
EntryToken - This is the marker used to indicate the start of a region.
unsigned getResNo() const
get the index which selects a specific result in the SDNode
void dumpr() const
dumpr - Dump (recursively) this node and its use-def subgraph.
void WriteAsOperand(raw_ostream &, const Value *, bool PrintTy=true, const Module *Context=0)
void print_types(raw_ostream &OS, const SelectionDAG *G) const
virtual const char * getTargetNodeName(unsigned Opcode) const
This method returns the name of a target specific DAG node.
std::string getEVTString() const
getEVTString - This function returns value type as a string, e.g. "i32".
PCMARKER - This corresponds to the pcmarker intrinsic.
const HexagonInstrInfo * TII
#define llvm_unreachable(msg)
EVT getValueType(unsigned ResNo) const
allnodes_const_iterator allnodes_end() const
static void printrWithDepthHelper(raw_ostream &OS, const SDNode *N, const SelectionDAG *G, unsigned depth, unsigned indent)
unsigned getNumValues() const
Simple integer binary arithmetic operators.
static std::string utostr(uint64_t X, bool isNeg=false)
static void DumpNodesr(raw_ostream &OS, const SDNode *N, unsigned indent, const SelectionDAG *G, VisitedSDNodeSet &once)
static const char * getIndexedModeName(ISD::MemIndexedMode AM)
UNDEF - An undefined node.
SDNode * getNode() const
get the SDNode which holds the desired result
void dumprFull(const SelectionDAG *G=0) const
Control flow instructions. These all have token chains.
Simple binary floating point operators.
void printr(raw_ostream &OS, const SelectionDAG *G=0) const
ItTy next(ItTy it, Dist n)
void print(raw_ostream &OS, const SelectionDAG *G=0) const
TRAP - Trapping instruction.
DEBUGTRAP - Trap intended to get the attention of a debugger.
Bit counting operators with an undefined result for zero inputs.
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
HANDLENODE node - Used as a handle for various purposes.
const SDValue & getRoot() const
void printrWithDepth(raw_ostream &O, const SelectionDAG *G=0, unsigned depth=100) const
virtual const TargetInstrInfo * getInstrInfo() const
allnodes_const_iterator allnodes_begin() const
Byte Swap and Counting operators.
void dumprWithDepth(const SelectionDAG *G=0, unsigned depth=100) const
void print_details(raw_ostream &OS, const SelectionDAG *G) const
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
ZERO_EXTEND - Used for integer types, zeroing the new bits.
ANY_EXTEND - Used for integer types. The high bits are undefined.
static const fltSemantics IEEEsingle
Bitwise operators - logical and, logical or, logical xor.
std::string getName(ID id, ArrayRef< Type * > Tys=None)
virtual const TargetIntrinsicInfo * getIntrinsicInfo() const
FSINCOS - Compute both fsin and fcos as a single operation.
const TargetLowering & getTargetLoweringInfo() const
TRUNCATE - Completely drop the high bits.
bool isMachineOpcode() const
unsigned getMachineOpcode() const
std::string getOperationName(const SelectionDAG *G=0) const