mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
When inserting new instructions, use getFirstInsertionPt instead of
getFirstNonPHI so that it will skip over the landingpad instructions as well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138537 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -3621,10 +3621,11 @@ void LSRInstance::RewriteForPHI(PHINode *PN,
|
||||
// users.
|
||||
if (e != 1 && BB->getTerminator()->getNumSuccessors() > 1 &&
|
||||
!isa<IndirectBrInst>(BB->getTerminator())) {
|
||||
Loop *PNLoop = LI.getLoopFor(PN->getParent());
|
||||
if (!PNLoop || PN->getParent() != PNLoop->getHeader()) {
|
||||
BasicBlock *Parent = PN->getParent();
|
||||
Loop *PNLoop = LI.getLoopFor(Parent);
|
||||
if (!PNLoop || Parent != PNLoop->getHeader()) {
|
||||
// Split the critical edge.
|
||||
BasicBlock *NewBB = SplitCriticalEdge(BB, PN->getParent(), P);
|
||||
BasicBlock *NewBB = SplitCriticalEdge(BB, Parent, P);
|
||||
|
||||
// If PN is outside of the loop and BB is in the loop, we want to
|
||||
// move the block to be immediately before the PHI block, not
|
||||
|
Reference in New Issue
Block a user