mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-01 03:33:42 +00:00
Implement LoopStrengthReduce/share_code_in_preheader.ll by having one
rewriter for all code inserted into the preheader, which is never flushed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22702 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8e2dbb6646
commit
5272f3c669
@ -542,6 +542,8 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(Value *Stride,
|
||||
}
|
||||
|
||||
SCEVExpander Rewriter(*SE, *LI);
|
||||
SCEVExpander PreheaderRewriter(*SE, *LI);
|
||||
|
||||
BasicBlock *Preheader = L->getLoopPreheader();
|
||||
Instruction *PreInsertPt = Preheader->getTerminator();
|
||||
Instruction *PhiInsertBefore = L->getHeader()->begin();
|
||||
@ -578,7 +580,8 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(Value *Stride,
|
||||
|
||||
// Emit the initial base value into the loop preheader, and add it to the
|
||||
// Phi node.
|
||||
Value *BaseV = Rewriter.expandCodeFor(Base, PreInsertPt, ReplacedTy);
|
||||
Value *BaseV = PreheaderRewriter.expandCodeFor(Base, PreInsertPt,
|
||||
ReplacedTy);
|
||||
NewPHI->addIncoming(BaseV, Preheader);
|
||||
|
||||
// Emit the increment of the base value before the terminator of the loop
|
||||
|
Loading…
x
Reference in New Issue
Block a user