aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SSI.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-08-19 06:24:33 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-08-19 06:24:33 +0000
commit3417e8f185e9d866df6a604976237e2f0a5e5deb (patch)
treecc01c44ca0a1990250eed863d471211cbc8498bd /lib/Transforms/Utils/SSI.cpp
parent663c2d2580e6e9b2435785c7e5a2de18758860a3 (diff)
Be more careful when modifying PHI nodes. Patch by Andre Tavares.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79407 91177308-0d34-0410-b5e6-96231b3b80d8
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));