[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
GitOrigin-RevId: b16f6da50b3b730abf8eb68ba68ba0cf71d29c34
2 files changed
tree: 48c207e44eb6919c93163ebb2c7206c1007727c7
  1. benchmark/
  2. cmake/
  3. docs/
  4. examples/
  5. include/
  6. lib/
  7. python/
  8. test/
  9. tools/
  10. unittests/
  11. utils/
  12. .clang-format
  13. .clang-tidy
  14. CMakeLists.txt
  15. LICENSE.TXT
  16. Maintainers.md
  17. README.md
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.