Add the actual constant to the hash for ConstantPool nodes. Thanks to
authorChris Lattner <sabre@nondot.org>
Mon, 14 Aug 2006 20:12:44 +0000 (20:12 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 14 Aug 2006 20:12:44 +0000 (20:12 +0000)
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
lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp

index 72a7d330016b9400f26d3ffb6e184cc51ab3bc87..6fd8ba2a9ec4e56ef32da2e84aa062d1791bbd8c 100644 (file)
@@ -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);
index de5302adeaf71112cca0fabe5f8f79fd06edfccf..b42c70bb56d0de5d7b4201fc4f6de239ec850616 100644 (file)
@@ -64,6 +64,7 @@ SelectionDAGCSEMap::NodeID::NodeID(SDNode *N) {
     case ISD::TargetConstantPool:
       AddInteger(cast<ConstantPoolSDNode>(N)->getAlignment());
       AddInteger(cast<ConstantPoolSDNode>(N)->getOffset());
+      AddPointer(cast<ConstantPoolSDNode>(N)->get());
       break;
     }
   }