[llvm] [SCEV] Add predicate in SolveLinEq to ensure B is a multiple of A. (PR #108777)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 11:53:25 PDT 2024


================
@@ -10137,8 +10140,17 @@ static const SCEV *SolveLinEquationWithOverflow(const APInt &A, const SCEV *B,
   //
   // B is divisible by D if and only if the multiplicity of prime factor 2 for B
   // is not less than multiplicity of this prime factor for D.
-  if (SE.getMinTrailingZeros(B) < Mult2)
-    return SE.getCouldNotCompute();
+  if (SE.getMinTrailingZeros(B) < Mult2) {
----------------
preames wrote:

Should we maybe try to prove that (urem B, A) == 0 before resorting to the predicate?

https://github.com/llvm/llvm-project/pull/108777


More information about the llvm-commits mailing list