[Mlir-commits] [mlir] [mlir][IR] Fix bug in AffineExpr simplifier `lhs % rhs` where `lhs = lhs floordiv rhs` (PR #119245)

Kunwar Grover llvmlistbot at llvm.org
Wed Dec 11 16:22:07 PST 2024


================
@@ -1385,7 +1385,7 @@ LogicalResult SimpleAffineExprFlattener::visitModExpr(AffineBinaryOpExpr expr) {
     lhs[getLocalVarStartIndex() + numLocals - 1] = -rhsConst;
   } else {
     // Reuse the existing local id.
-    lhs[getLocalVarStartIndex() + loc] = -rhsConst;
+    lhs[getLocalVarStartIndex() + loc] -= rhsConst;
----------------
Groverkss wrote:

Actually, I printed it and I see what is happening here. Your change makes sense.

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


More information about the Mlir-commits mailing list