aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SSI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils/SSI.cpp')
-rw-r--r--lib/Transforms/Utils/SSI.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/SSI.cpp b/lib/Transforms/Utils/SSI.cpp
index 7bb9495f3c..b4e683417c 100644
--- a/lib/Transforms/Utils/SSI.cpp
+++ b/lib/Transforms/Utils/SSI.cpp
@@ -316,7 +316,8 @@ void SSI::fixPhis() {
for (unsigned i = 0, e = PN->getNumIncomingValues(); i < e; ++i) {
PHINode *PN_father;
if ((PN_father = dyn_cast<PHINode>(PN->getIncomingValue(i))) &&
- PN->getParent() == PN_father->getParent()) {
+ PN->getParent() == PN_father->getParent() &&
+ !DT_->dominates(PN->getParent(), PN->getIncomingBlock(i))) {
BasicBlock *BB = PN->getIncomingBlock(i);
int pos = PN_father->getBasicBlockIndex(BB);
PN->setIncomingValue(i, PN_father->getIncomingValue(pos));