Do better with physical reg operands (typically, from inline asm)
[oota-llvm.git] / lib / Analysis / SparsePropagation.cpp
index 8a74745dd3fb62c379f3e9bbc0079117fd10234d..d7bcac2b1e2d2215f17422227266ae195b0ec917 100644 (file)
@@ -166,6 +166,11 @@ void SparseSolver::getFeasibleSuccessors(TerminatorInst &TI,
     return;
   }
   
+  if (isa<IndirectBrInst>(TI)) {
+    Succs.assign(Succs.size(), true);
+    return;
+  }
+  
   SwitchInst &SI = cast<SwitchInst>(TI);
   LatticeVal SCValue;
   if (AggressiveUndef)
@@ -223,6 +228,9 @@ void SparseSolver::visitTerminatorInst(TerminatorInst &TI) {
 }
 
 void SparseSolver::visitPHINode(PHINode &PN) {
+  // The lattice function may store more information on a PHINode than could be
+  // computed from its incoming values.  For example, SSI form stores its sigma
+  // functions as PHINodes with a single incoming value.
   if (LatticeFunc->IsSpecialCasedPHI(&PN)) {
     LatticeVal IV = LatticeFunc->ComputeInstructionState(PN, *this);
     if (IV != LatticeFunc->getUntrackedVal())