aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-09-12 21:00:35 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-09-12 21:00:35 +0000
commitd6594ae54cfde4db4d30272192645c0a45fb9902 (patch)
tree7b89d2a0c89f9fc9bdb58acad508acd59cf3702d /lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp
parentcd5731d98b15c9de236bd0dd6c9c57d9bcecbceb (diff)
Added support for machine specific constantpool values. These are useful for
representing expressions that can only be resolved at link time, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp
index 7cec545f5d..498e9efc81 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/SelectionDAG.h"
+#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/Support/MathExtras.h"
using namespace llvm;
@@ -70,7 +71,11 @@ SelectionDAGCSEMap::NodeID::NodeID(SDNode *N) {
case ISD::TargetConstantPool:
AddInteger(cast<ConstantPoolSDNode>(N)->getAlignment());
AddInteger(cast<ConstantPoolSDNode>(N)->getOffset());
- AddPointer(cast<ConstantPoolSDNode>(N)->get());
+ if (cast<ConstantPoolSDNode>(N)->isMachineConstantPoolEntry())
+ cast<ConstantPoolSDNode>(N)->getMachineCPVal()->
+ AddSelectionDAGCSEId(this);
+ else
+ AddPointer(cast<ConstantPoolSDNode>(N)->getConstVal());
break;
}
}