Added support for machine specific constantpool values. These are useful for
representing expressions that can only be resolved at link time, etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30278 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp
index 7cec545..498e9ef 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGCSEMap.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/CodeGen/SelectionDAG.h"
+#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/Support/MathExtras.h"
using namespace llvm;
@@ -70,7 +71,11 @@
case ISD::TargetConstantPool:
AddInteger(cast<ConstantPoolSDNode>(N)->getAlignment());
AddInteger(cast<ConstantPoolSDNode>(N)->getOffset());
- AddPointer(cast<ConstantPoolSDNode>(N)->get());
+ if (cast<ConstantPoolSDNode>(N)->isMachineConstantPoolEntry())
+ cast<ConstantPoolSDNode>(N)->getMachineCPVal()->
+ AddSelectionDAGCSEId(this);
+ else
+ AddPointer(cast<ConstantPoolSDNode>(N)->getConstVal());
break;
}
}