diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 72a7d330016b..6fd8ba2a9ec4 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/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/llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp index de5302adeaf7..b42c70bb56d0 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp +++ b/llvm/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; } }