Add the actual constant to the hash for ConstantPool nodes. Thanks to

Rafael Espindola for pointing this out.

llvm-svn: 29669
This commit is contained in:
Chris Lattner 2006-08-14 20:12:44 +00:00
parent a496ec35ed
commit 8e37283d8b
2 changed files with 2 additions and 0 deletions

View 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);

View 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;
}
}