Fix bug: TailDup/2003-06-24-Simpleloop.ll
authorChris Lattner <sabre@nondot.org>
Tue, 24 Jun 2003 19:48:06 +0000 (19:48 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 24 Jun 2003 19:48:06 +0000 (19:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6881 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/TailDuplication.cpp

index e736f970af5ee0ea50a8df06287fa3d282639f2a..04736f07e144cf7bc4512e4c1dde55120f31e1f7 100644 (file)
@@ -203,7 +203,8 @@ void TailDup::InsertPHINodesIfNecessary(Instruction *OrigInst, Value *NewInst,
   for (Value::use_iterator I = OrigInst->use_begin(), E = OrigInst->use_end();
        I != E; ++I) {
     Instruction *In = cast<Instruction>(*I);
-    if (In->getParent() != OrigBlock)  // Don't modify uses in the orig block!
+    if (In->getParent() != OrigBlock ||  // Don't modify uses in the orig block!
+        isa<PHINode>(In))
       Users.push_back(In);
   }