diff options
author | Evan Cheng <evan.cheng@apple.com> | 2005-12-20 06:22:03 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2005-12-20 06:22:03 +0000 |
commit | 7226158d7e3986e55b58214a749aa4eabb3fb6d5 (patch) | |
tree | 03b4e5b249ef9db846734225c9048faf8d371697 /lib | |
parent | dae87b65365a8a3dae8e41c2e836572388ec84ba (diff) |
Added a hook to print out names of target specific DAG nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 13 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 3 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 17 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.h | 4 |
4 files changed, 32 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index ad8cca742a..3438863c90 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1835,15 +1835,18 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const { if (getOpcode() < ISD::BUILTIN_OP_END) return "<<Unknown DAG Node>>"; else { - if (G) + if (G) { if (const TargetInstrInfo *TII = G->getTarget().getInstrInfo()) if (getOpcode()-ISD::BUILTIN_OP_END < TII->getNumOpcodes()) return TII->getName(getOpcode()-ISD::BUILTIN_OP_END); - std::string Name - = "<<Unknown Target Node:" - + itostr((int)getOpcode()-ISD::BUILTIN_OP_END) + ">>"; - return Name.c_str(); + TargetLowering &TLI = G->getTargetLoweringInfo(); + const char *Name = + TLI.getTargetNodeName(getOpcode()); + if (Name) return Name; + } + + return "<<Unknown Target Node>>"; } case ISD::PCMARKER: return "PCMarker"; diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 415084e2f1..8e9524ef1e 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -122,3 +122,6 @@ void TargetLowering::computeRegisterProperties() { TransformToType[MVT::f64] = MVT::f64; } +const char *TargetLowering::getTargetNodeName(unsigned Opcode) const { + return NULL; +} diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 776ff6c8a9..496f10548c 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -970,3 +970,20 @@ SDOperand X86TargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { } } } + +const char *X86TargetLowering::getTargetNodeName(unsigned Opcode) const { + switch (Opcode) { + default: return NULL; + case X86ISD::FILD64m: return "X86ISD::FILD64m"; + case X86ISD::FP_TO_INT16_IN_MEM: return "X86ISD::FP_TO_INT16_IN_MEM"; + case X86ISD::FP_TO_INT32_IN_MEM: return "X86ISD::FP_TO_INT32_IN_MEM"; + case X86ISD::FP_TO_INT64_IN_MEM: return "X86ISD::FP_TO_INT64_IN_MEM"; + case X86ISD::CALL: return "X86ISD::CALL"; + case X86ISD::TAILCALL: return "X86ISD::TAILCALL"; + case X86ISD::RDTSC_DAG: return "X86ISD::RDTSC_DAG"; + case X86ISD::CMP: return "X86ISD::CMP"; + case X86ISD::TEST: return "X86ISD::TEST"; + case X86ISD::CMOV: return "X86ISD::CMOV"; + case X86ISD::BRCOND: return "X86ISD::BRCOND"; + } +} diff --git a/lib/Target/X86/X86ISelLowering.h b/lib/Target/X86/X86ISelLowering.h index 918b23420d..b1ce8e22b0 100644 --- a/lib/Target/X86/X86ISelLowering.h +++ b/lib/Target/X86/X86ISelLowering.h @@ -123,6 +123,10 @@ namespace llvm { LowerFrameReturnAddress(bool isFrameAddr, SDOperand Chain, unsigned Depth, SelectionDAG &DAG); + /// getTargetNodeName - This method returns the name of a target specific + /// DAG node. + virtual const char *getTargetNodeName(unsigned Opcode) const; + SDOperand getReturnAddressFrameIndex(SelectionDAG &DAG); private: |