[all-commits] [llvm/llvm-project] 006986: [mlir][affine] Add ValueBounds-based simplificatio...
Zhewen Yu via All-commits
all-commits at lists.llvm.org
Mon Mar 30 02:25:27 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 00698678e404699f6c776679272a7e3392c46306
https://github.com/llvm/llvm-project/commit/00698678e404699f6c776679272a7e3392c46306
Author: Zhewen Yu <zhewenyu at amd.com>
Date: 2026-03-30 (Mon, 30 Mar 2026)
Changed paths:
M mlir/include/mlir/Dialect/Affine/Transforms/Passes.td
M mlir/include/mlir/Dialect/Affine/Transforms/Transforms.h
M mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
A mlir/lib/Dialect/Affine/Transforms/SimplifyAffineWithBounds.cpp
A mlir/test/Dialect/Affine/simplify-with-bounds.mlir
Log Message:
-----------
[mlir][affine] Add ValueBounds-based simplification for delinearize(linearize) pairs (#187245)
`affine.linearize_index` pairs
(`CancelDelinearizeOfLinearizeDisjointExactTail`) only match when basis
elements are exactly equal as `OpFoldResult` values. This means they
cannot simplify cases where dynamic basis products are semantically
equal but represented by different SSA values or affine expressions.
This patch adds a new pass `affine-simplify-with-bounds` with two
rewrite patterns that use `ValueBoundsConstraintSet` to prove equality
of basis products:
- **`SimplifyDelinearizeOfLinearizeDisjointManyToOneTail`**: matches
when multiple consecutive linearize dimensions have a product equal to a
single delinearize dimension (many-to-one).
- **`SimplifyDelinearizeOfLinearizeDisjointOneToManyTail`**: matches
when a single linearize dimension equals the product of multiple
consecutive delinearize dimensions (one-to-many).
Both patterns scan from the tail (innermost dimensions) and support
partial matching. Unmatched prefix dimensions are left as residual
linearize/delinearize operations.
Assisted-by: Cursor (Claude)
---------
Signed-off-by: Yu-Zhewen <zhewenyu at amd.com>
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