mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-18 10:24:45 +00:00
Permit ChangeCompareStride to rewrite a comparison when the factor
between the comparison's iv stride and the candidate stride is exactly -1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70244 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2028,7 +2028,9 @@ ICmpInst *LoopStrengthReduce::ChangeCompareStride(Loop *L, ICmpInst *Cond,
|
||||
if (!isa<SCEVConstant>(SI->first))
|
||||
continue;
|
||||
int64_t SSInt = cast<SCEVConstant>(SI->first)->getValue()->getSExtValue();
|
||||
if (abs(SSInt) <= abs(CmpSSInt) || (SSInt % CmpSSInt) != 0)
|
||||
if (SSInt == CmpSSInt ||
|
||||
abs(SSInt) < abs(CmpSSInt) ||
|
||||
(SSInt % CmpSSInt) != 0)
|
||||
continue;
|
||||
|
||||
Scale = SSInt / CmpSSInt;
|
||||
|
Reference in New Issue
Block a user