[all-commits] [llvm/llvm-project] a177be: [mlir][Linalg] Bugfix in decompose generic by unfo...
gdehame via All-commits
all-commits at lists.llvm.org
Mon Feb 17 03:21:21 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a177be5528337575ee1b7079958d4250b2eb749f
https://github.com/llvm/llvm-project/commit/a177be5528337575ee1b7079958d4250b2eb749f
Author: gdehame <145553531+gdehame at users.noreply.github.com>
Date: 2025-02-17 (Mon, 17 Feb 2025)
Changed paths:
M mlir/lib/Dialect/Linalg/Transforms/DecomposeGenericByUnfoldingPermutation.cpp
Log Message:
-----------
[mlir][Linalg] Bugfix in decompose generic by unfolding permutation (#126737)
The pattern was returning success() by default which made the greedy
pattern application act as if the IR was modified and even though
nothing was changed and thus it can prevent it from converging for no
legitimate reason.
The patch makes the rewrite pattern return failure() by default and
success() if and only if the IR changed.
An example of unexpected behavior is by running `mlir-opt input.mlir
--linalg-specialize-generic-ops`, we obtain an empty mlir as output with
`input.mlir` as follows:
```
#map = affine_map<(d0) -> (d0)>
func.func @f(%arg0: tensor<8xi32>, %arg1: tensor<8xi32>) -> tensor<8xi32> {
%0 = tensor.empty() : tensor<8xi32>
%1 = linalg.generic {indexing_maps = [#map, #map, #map], iterator_types = ["parallel"]} ins(%arg0, %arg1: tensor<8xi32>, tensor<8xi32>) outs(%0: tensor<8xi32>) {
^bb0(%in: i32, %in_0: i32, %out: i32):
%2 = arith.addi %in, %in_0: i32
linalg.yield %2: i32
} -> tensor<8xi32>
return %1 : tensor<8xi32>
}
```
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