[all-commits] [llvm/llvm-project] b16f6d: [mlir][affine] Fix crash in addAffineParallelOpDom...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Mon Mar 23 05:22:03 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b16f6da50b3b730abf8eb68ba68ba0cf71d29c34
      https://github.com/llvm/llvm-project/commit/b16f6da50b3b730abf8eb68ba68ba0cf71d29c34
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-03-23 (Mon, 23 Mar 2026)

  Changed paths:
    M mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
    M mlir/test/Dialect/Affine/memref-dependence-check.mlir

  Log Message:
  -----------
  [mlir][affine] Fix crash in addAffineParallelOpDomain with min/max bounds (#184130)

`addAffineParallelOpDomain` checked `isConstant()` on the per-IV bound
maps of `affine.parallel`, then called `getSingleConstantResult()`.
However, `isConstant()` returns true for maps with *any* number of
constant results, while `getSingleConstantResult()` asserts exactly one.

When an `affine.parallel` has a multi-result bound (e.g., `to (min(128,
122))`), the per-IV upper bound map has two results `{128, 122}`, so
`isConstant()` is true but the subsequent `getSingleConstantResult()`
call aborts.

Fix by using `isSingleConstant()` (which requires exactly one result)
instead. Multi-result constant maps (min/max with all-constant
alternatives) are then handled by the general `addBound` path, which
correctly models the min/max semantics as multiple constraints.

Fixes #61734

Assisted-by: Claude Code



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list