mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Don't split critical edges during the AddUsersIfInteresting phase
of LSR. This makes the AddUsersIfInteresting phase of LSR a pure analysis instead of a phase that potentially does CFG modifications. The conditions where this code would actually perform a split are rare, and in the cases where it actually would do a split the split is usually undone by CodeGenPrepare, and in cases where splits actually survive into codegen, they appear to hurt more often than they help. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70625 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dd47f88cfe
commit
1dcad96dc6
@ -406,20 +406,7 @@ static bool IVUseShouldUsePostIncValue(Instruction *User, Instruction *IV,
|
||||
}
|
||||
|
||||
// Okay, all uses of IV by PN are in predecessor blocks that really are
|
||||
// dominated by the latch block. Split the critical edges and use the
|
||||
// post-incremented value.
|
||||
for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i)
|
||||
if (PN->getIncomingValue(i) == IV) {
|
||||
SplitCriticalEdge(PN->getIncomingBlock(i), PN->getParent(), P, false);
|
||||
// Splitting the critical edge can reduce the number of entries in this
|
||||
// PHI.
|
||||
e = PN->getNumIncomingValues();
|
||||
if (--NumUses == 0) break;
|
||||
}
|
||||
|
||||
// PHI node might have become a constant value after SplitCriticalEdge.
|
||||
DeadInsts.push_back(User);
|
||||
|
||||
// dominated by the latch block. Use the post-incremented value.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user