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

Uday Bondhugula llvmlistbot at llvm.org
Mon Jun 23 01:54:19 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:

Instead of dyn_cast + assert, use `cast` and add the assertion message as a comment on top.

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


More information about the Mlir-commits mailing list