Revert "Revert "Add Constant Hoisting Pass" (r200034)"
[oota-llvm.git] / include / llvm / CodeGen / SelectionDAGNodes.h
index 00773b3e6612b89e012f687add0bfcb2e4cc825d..976d212ce3d16d73db508b60c256bc221bcea5a4 100644 (file)
@@ -1250,9 +1250,10 @@ public:
 class ConstantSDNode : public SDNode {
   const ConstantInt *Value;
   friend class SelectionDAG;
-  ConstantSDNode(bool isTarget, const ConstantInt *val, EVT VT)
+  ConstantSDNode(bool isTarget, bool isOpaque, const ConstantInt *val, EVT VT)
     : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant,
              0, DebugLoc(), getSDVTList(VT)), Value(val) {
+    SubclassData |= isOpaque;
   }
 public:
 
@@ -1265,6 +1266,8 @@ public:
   bool isNullValue() const { return Value->isNullValue(); }
   bool isAllOnesValue() const { return Value->isAllOnesValue(); }
 
+  bool isOpaque() const { return SubclassData & 1; }
+
   static bool classof(const SDNode *N) {
     return N->getOpcode() == ISD::Constant ||
            N->getOpcode() == ISD::TargetConstant;