remove some trickiness that broke yacr2 and some other programs last night
authorChris Lattner <sabre@nondot.org>
Wed, 10 Aug 2005 17:15:20 +0000 (17:15 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 10 Aug 2005 17:15:20 +0000 (17:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22751 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/LoopSimplify.cpp

index 69b2ec444707d378020ef8898002f10ddd6f6148..fcea05402d02c36b1cbfda9cea48a8ecb37e4b01 100644 (file)
@@ -197,9 +197,7 @@ bool LoopSimplify::ProcessLoop(Loop *L) {
   DominatorSet &DS = getAnalysis<DominatorSet>();
   for (BasicBlock::iterator I = L->getHeader()->begin();
        (PN = dyn_cast<PHINode>(I++)); )
-    if (Value *V = PN->hasConstantValue(true))
-      if (!isa<Instruction>(V) ||
-          DS.dominates(cast<Instruction>(V)->getParent(), L->getHeader())) {
+    if (Value *V = PN->hasConstantValue()) {
         PN->replaceAllUsesWith(V);
         PN->eraseFromParent();
       }