aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/TailDuplication.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp
index e736f970af..04736f07e1 100644
--- a/lib/Transforms/Scalar/TailDuplication.cpp
+++ b/lib/Transforms/Scalar/TailDuplication.cpp
@@ -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);
}