diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-17 00:33:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-17 00:33:30 +0000 |
commit | 056f9f61d071c6c583951678f2bf543a1316efcc (patch) | |
tree | aaa8f076843814c52de69259e45c6a6c9a7af09d /include/llvm/CodeGen/SelectionDAGNodes.h | |
parent | 456f1e890cb059fedb9f5d3f315c80e4f98f429b (diff) |
add some helper methods, and a new TargetConstant node, which is not
subjected to folding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/SelectionDAGNodes.h')
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 4eecb0a6b7..00b94037ad 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -56,6 +56,10 @@ namespace ISD { // Various leaf nodes. Constant, ConstantFP, GlobalAddress, FrameIndex, ConstantPool, BasicBlock, ExternalSymbol, VALUETYPE, CONDCODE, Register, + + // TargetConstant - Like Constant, but the DAG does not do any folding or + // simplification of the constant. This is used by the DAG->DAG selector. + TargetConstant, // CopyToReg - This node has three operands: a chain, a register number to // set to this value, and a value. @@ -681,8 +685,8 @@ class ConstantSDNode : public SDNode { uint64_t Value; protected: friend class SelectionDAG; - ConstantSDNode(uint64_t val, MVT::ValueType VT) - : SDNode(ISD::Constant, VT), Value(val) { + ConstantSDNode(bool isTarget, uint64_t val, MVT::ValueType VT) + : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, VT), Value(val) { } public: @@ -702,7 +706,8 @@ public: static bool classof(const ConstantSDNode *) { return true; } static bool classof(const SDNode *N) { - return N->getOpcode() == ISD::Constant; + return N->getOpcode() == ISD::Constant || + N->getOpcode() == ISD::TargetConstant; } }; |