mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
Factor out code that optimize loop terminating condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71305 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -164,8 +164,11 @@ namespace {
|
|||||||
ICmpInst *ChangeCompareStride(Loop *L, ICmpInst *Cond,
|
ICmpInst *ChangeCompareStride(Loop *L, ICmpInst *Cond,
|
||||||
IVStrideUse* &CondUse,
|
IVStrideUse* &CondUse,
|
||||||
const SCEVHandle* &CondStride);
|
const SCEVHandle* &CondStride);
|
||||||
|
|
||||||
void OptimizeIndvars(Loop *L);
|
void OptimizeIndvars(Loop *L);
|
||||||
|
|
||||||
|
void OptimizeLoopTermCond(Loop *L);
|
||||||
|
|
||||||
/// OptimizeShadowIV - If IV is used in a int-to-float cast
|
/// OptimizeShadowIV - If IV is used in a int-to-float cast
|
||||||
/// inside the loop then try to eliminate the cast opeation.
|
/// inside the loop then try to eliminate the cast opeation.
|
||||||
void OptimizeShadowIV(Loop *L);
|
void OptimizeShadowIV(Loop *L);
|
||||||
@ -2378,6 +2381,12 @@ void LoopStrengthReduce::OptimizeIndvars(Loop *L) {
|
|||||||
|
|
||||||
OptimizeShadowIV(L);
|
OptimizeShadowIV(L);
|
||||||
|
|
||||||
|
OptimizeLoopTermCond(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// OptimizeLoopTermCond - Change loop terminating condition to use the
|
||||||
|
/// postinc iv when possible.
|
||||||
|
void LoopStrengthReduce::OptimizeLoopTermCond(Loop *L) {
|
||||||
// Finally, get the terminating condition for the loop if possible. If we
|
// Finally, get the terminating condition for the loop if possible. If we
|
||||||
// can, we want to change it to use a post-incremented version of its
|
// can, we want to change it to use a post-incremented version of its
|
||||||
// induction variable, to allow coalescing the live ranges for the IV into
|
// induction variable, to allow coalescing the live ranges for the IV into
|
||||||
|
Reference in New Issue
Block a user