1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Be more careful when modifying PHI nodes. Patch by Andre Tavares.

llvm-svn: 79407
This commit is contained in:
Nick Lewycky 2009-08-19 06:24:33 +00:00
parent 57b873fda0
commit ed3dcdbdb8

View File

@ -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));