[Mlir-commits] [mlir] [mlir][linalg] Add folder for `linalg.index` (PR #136640)
Jakub Kuderski
llvmlistbot at llvm.org
Tue Apr 22 08:00:51 PDT 2025
================
@@ -305,6 +305,86 @@ func.func @self_copy(%arg0 : memref<2x3x?x4xf32>) {
}
// -----
+
+// CHECK: func @fold_linalg_index_tensor_static
+func.func @fold_linalg_index_tensor_static(%0: tensor<4x16xi32>, %1: tensor<1x16xi32>,
+ %2: tensor<4x1xi32>) -> tensor<4x1xi32> {
+// CHECK-NEXT: linalg.generic
+// CHECK: %[[IDX_0:.+]] = linalg.index 0 : index
+// CHECK-NOT: linalg.index 1
----------------
kuhar wrote:
We match the full `linalg.yield`, so the `CHECK-NOT` is really for documentation/readability. I think it's also reasonable to assume that instructions won't be reordered at random.
https://github.com/llvm/llvm-project/pull/136640
More information about the Mlir-commits
mailing list