[all-commits] [llvm/llvm-project] 2feba9: [MLIR] Allow recovering from semi-affine sets in F...

William Moses via All-commits all-commits at lists.llvm.org
Mon Jul 27 15:17:30 PDT 2026


  Branch: refs/heads/users/wsmoses/aff
  Home:   https://github.com/llvm/llvm-project
  Commit: 2feba9bab0cf5e789ed1ca195bd42757021e5a49
      https://github.com/llvm/llvm-project/commit/2feba9bab0cf5e789ed1ca195bd42757021e5a49
  Author: William S. Moses <gh at wsmoses.com>
  Date:   2026-07-27 (Mon, 27 Jul 2026)

  Changed paths:
    M mlir/include/mlir/Analysis/FlatLinearValueConstraints.h
    M mlir/include/mlir/Dialect/Affine/Analysis/AffineStructures.h
    M mlir/lib/Analysis/FlatLinearValueConstraints.cpp
    M mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
    M mlir/lib/Dialect/Affine/Analysis/Utils.cpp
    M mlir/unittests/Analysis/Presburger/Parser.h

  Log Message:
  -----------
  [MLIR] Allow recovering from semi-affine sets in FlatLinearValueConstraints

The IntegerSet constructor of FlatLinearValueConstraints asserts when
flattening fails, which happens for semi-affine integer sets. Since the
failure is signalled from inside a constructor, callers have no way to
detect the unsupported case ahead of time and no way to work around it;
they simply crash.

Make that constructor protected and expose the construction through
`FlatLinearValueConstraints::create` (and the corresponding
`FlatAffineValueConstraints::create`), which returns a `FailureOr` and
so lets callers handle a semi-affine set gracefully.

Existing in-tree users are updated: `addAffineIfOpDomain` keeps asserting
as before, and `simplifyIntegerSet` now returns the set unchanged instead
of asserting, since a semi-affine set simply cannot be simplified this way.



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