mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +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:
parent
24ad00db5a
commit
50eafbc828
@ -157,8 +157,13 @@ void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) {
|
||||
}
|
||||
} else if (PHINode *PN = dyn_cast<PHINode>(cast<Instruction>(*UI))) {
|
||||
// If the user of this instruction is a PHI node in the current block,
|
||||
// spill the value.
|
||||
ShouldDemote = true;
|
||||
// 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;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ShouldDemote) {
|
||||
|
Loading…
Reference in New Issue
Block a user