Fix an incredibly subtle bug exposed by Ted's change to APInt profiling.
authorChris Lattner <sabre@nondot.org>
Wed, 20 Feb 2008 06:28:01 +0000 (06:28 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 20 Feb 2008 06:28:01 +0000 (06:28 +0000)
AddNodeIDNode does profiling for a ConstantSDNode, but so does
SelectionDAG::getConstant.  This profiling should be moved to a common
static function in ConstantSDNode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47359 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index f904fa16d58f02c488d2262172b5eb03522e86c7..eb3729c813f6ba17b7d6df43b6fb1aa19d0c6e44 100644 (file)
@@ -361,7 +361,7 @@ static void AddNodeIDNode(FoldingSetNodeID &ID, SDNode *N) {
   default: break;  // Normal nodes don't need extra info.
   case ISD::TargetConstant:
   case ISD::Constant:
-    ID.AddInteger(cast<ConstantSDNode>(N)->getValue());
+    ID.Add(cast<ConstantSDNode>(N)->getAPIntValue());
     break;
   case ISD::TargetConstantFP:
   case ISD::ConstantFP: {