[Mlir-commits] [mlir] Fix bug in `visitDivExpr` and `visitModExpr` (PR #145290)

Uday Bondhugula llvmlistbot at llvm.org
Mon Jun 23 20:04:02 PDT 2025


================
@@ -1178,9 +1178,9 @@ static AffineExpr getSemiAffineExprFromFlatForm(ArrayRef<int64_t> flatExprs,
       continue;
     AffineExpr expr = it.value();
     auto binaryExpr = dyn_cast<AffineBinaryOpExpr>(expr);
-    if (!binaryExpr)
-      continue;
-
+    assert(binaryExpr &&
----------------
bondhugula wrote:

Yes, that's exactly what I meant. The assertion message (string) can be added as a comment so developers know better the reason for using `cast`.

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


More information about the Mlir-commits mailing list