mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Non-affine post-inc SCEV expansions have more code which must be
emitted after the increment. Make sure the insert position reflects this. This fixes PR6453. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97537 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1087,7 +1087,7 @@ Value *SCEVExpander::expand(const SCEV *S) {
|
||||
// If the SCEV is computable at this level, insert it into the header
|
||||
// after the PHIs (and after any other instructions that we've inserted
|
||||
// there) so that it is guaranteed to dominate any user inside the loop.
|
||||
if (L && S->hasComputableLoopEvolution(L))
|
||||
if (L && S->hasComputableLoopEvolution(L) && L != PostIncLoop)
|
||||
InsertPt = L->getHeader()->getFirstNonPHI();
|
||||
while (isInsertedInstruction(InsertPt))
|
||||
InsertPt = llvm::next(BasicBlock::iterator(InsertPt));
|
||||
|
Reference in New Issue
Block a user