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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 08:20:46 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) {
----------------
fhahn wrote:

IIUC that check shouldn't be true, otherwise we are missing some logic in `getMinTrailingZeros`? Added an assert that the check isn't true.

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


More information about the llvm-commits mailing list