"This patch adds a virtual call to AbstractLatticeFunction to derive a
[oota-llvm.git] / lib / Analysis / SparsePropagation.cpp
index 2fda64c733502ff7605f6cf83a1045d40b790e74..8f042c278392f6645bab6954233de8be3200b361 100644 (file)
@@ -57,8 +57,10 @@ SparseSolver::LatticeVal SparseSolver::getOrInitValueState(Value *V) {
     return LatticeFunc->getUntrackedVal();
   else if (Constant *C = dyn_cast<Constant>(V))
     LV = LatticeFunc->ComputeConstant(C);
+  else if (Argument *A = dyn_cast<Argument>(V))
+    LV = LatticeFunc->ComputeArgument(A);
   else if (!isa<Instruction>(V))
-    // Non-instructions (e.g. formal arguments) are overdefined.
+    // All other non-instructions are overdefined.
     LV = LatticeFunc->getOverdefinedVal();
   else
     // All instructions are underdefined by default.