[llvm] [SCEV] Use power of two facts involving vscale when inferring wrap flags (PR #101380)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 31 11:49:13 PDT 2024
================
@@ -12775,8 +12792,7 @@ ScalarEvolution::howManyLessThans(const SCEV *LHS, const SCEV *RHS,
if (!isLoopInvariant(RHS, L))
return false;
- auto *StrideC = dyn_cast<SCEVConstant>(AR->getStepRecurrence(*this));
- if (!StrideC || !StrideC->getAPInt().isPowerOf2())
+ if (!isKnownToBeAPowerOfTwo(AR->getStepRecurrence(*this), true))
----------------
nikic wrote:
```suggestion
if (!isKnownToBeAPowerOfTwo(AR->getStepRecurrence(*this), /*OrZero=*/true))
```
https://github.com/llvm/llvm-project/pull/101380
More information about the llvm-commits
mailing list