mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +00:00
Fix bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12458 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -157,8 +157,13 @@ void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) {
|
|||||||
}
|
}
|
||||||
} else if (PHINode *PN = dyn_cast<PHINode>(cast<Instruction>(*UI))) {
|
} else if (PHINode *PN = dyn_cast<PHINode>(cast<Instruction>(*UI))) {
|
||||||
// If the user of this instruction is a PHI node in the current block,
|
// If the user of this instruction is a PHI node in the current block,
|
||||||
// spill the value.
|
// which has an entry from another block using the value, spill it.
|
||||||
|
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
|
||||||
|
if (PN->getIncomingValue(i) == I &&
|
||||||
|
PN->getIncomingBlock(i) != DestBlock) {
|
||||||
ShouldDemote = true;
|
ShouldDemote = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ShouldDemote) {
|
if (ShouldDemote) {
|
||||||
|
Reference in New Issue
Block a user