Boost the power of phi node constant folding slightly: if all
[oota-llvm.git] / lib / Analysis / LazyValueInfo.cpp
index 74267e045ae7f1c9dd2840cea8e2ea8bd9a29add..88e18fa17918d21f17acd4556438dea3e052c950 100644 (file)
@@ -32,7 +32,7 @@ using namespace llvm;
 
 char LazyValueInfo::ID = 0;
 INITIALIZE_PASS(LazyValueInfo, "lazy-value-info",
-                "Lazy Value Information Analysis", false, true);
+                "Lazy Value Information Analysis", false, true)
 
 namespace llvm {
   FunctionPass *createLazyValueInfoPass() { return new LazyValueInfo(); }
@@ -201,6 +201,7 @@ public:
           return markOverdefined();
         return markNotConstant(RHS.getNotConstant());
       } else if (isConstantRange()) {
+         // FIXME: This could be made more precise.
         return markOverdefined();
       }
       
@@ -223,9 +224,12 @@ public:
       return markConstantRange(RHS.getConstantRange());
     }
     
-    // RHS must be a constant, we must be undef, constant, or notconstant.
-    assert(!isConstantRange() &&
-           "Constant and ConstantRange cannot be merged.");
+    // RHS must be a constant, we must be constantrange, 
+    // undef, constant, or notconstant.
+    if (isConstantRange()) {
+      // FIXME: This could be made more precise.
+      return markOverdefined();
+    }
     
     if (isUndefined())
       return markConstant(RHS.getConstant());