From 130fc13506b4da64981632c83734721a8b5b2d2d Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 14 Aug 2006 20:12:44 +0000 Subject: [PATCH] Add the actual constant to the hash for ConstantPool nodes. Thanks to Rafael Espindola for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29669 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 1 + lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 72a7d330016..6fd8ba2a9ec 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -583,6 +583,7 @@ SDOperand SelectionDAG::getConstantPool(Constant *C, MVT::ValueType VT, SelectionDAGCSEMap::NodeID ID(Opc, getNodeValueTypes(VT)); ID.AddInteger(Alignment); ID.AddInteger(Offset); + ID.AddPointer(C); void *IP = 0; if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP)) return SDOperand(E, 0); diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp index de5302adeaf..b42c70bb56d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp @@ -64,6 +64,7 @@ SelectionDAGCSEMap::NodeID::NodeID(SDNode *N) { case ISD::TargetConstantPool: AddInteger(cast(N)->getAlignment()); AddInteger(cast(N)->getOffset()); + AddPointer(cast(N)->get()); break; } }