diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-08-05 01:02:04 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-08-05 01:02:04 +0000 | 
| commit | 6f58350dafc03544ef338347d9848cbfc82fd4f9 (patch) | |
| tree | 326e1344f346e03ab020172dd8fd24570bb3462b /llvm | |
| parent | bcd8d2c6e5dcac9ca23efcf9d5396c2542671a92 (diff) | |
| download | bcm5719-llvm-6f58350dafc03544ef338347d9848cbfc82fd4f9.tar.gz bcm5719-llvm-6f58350dafc03544ef338347d9848cbfc82fd4f9.zip  | |
Now that hasConstantValue is more careful w.r.t. returning values that only
dominate the PHI node, this code can go away.  This also makes passes more
aggressive, e.g. implementing Transforms/CondProp/phisimplify2.ll
llvm-svn: 22670
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/VMCore/BasicBlock.cpp | 9 | 
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp index 407080cf68b..bdcfb365c6e 100644 --- a/llvm/lib/VMCore/BasicBlock.cpp +++ b/llvm/lib/VMCore/BasicBlock.cpp @@ -193,11 +193,10 @@ void BasicBlock::removePredecessor(BasicBlock *Pred,        PN->removeIncomingValue(Pred, false);        // If all incoming values to the Phi are the same, we can replace the Phi        // with that value. -      if (Value *PNV = PN->hasConstantValue()) -        if (!isa<Instruction>(PNV)) { -          PN->replaceAllUsesWith(PNV); -          PN->eraseFromParent(); -        } +      if (Value *PNV = PN->hasConstantValue()) { +        PN->replaceAllUsesWith(PNV); +        PN->eraseFromParent(); +      }      }    }  }  | 

