[all-commits] [llvm/llvm-project] 7ff3d3: [mlir][utils] Update generate-test-checks.py (use ...
Andrzej Warzyński via All-commits
all-commits at lists.llvm.org
Fri Apr 25 09:20:25 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7ff3d3bd1d5b0c9096377bf4c89d0de043dec805
https://github.com/llvm/llvm-project/commit/7ff3d3bd1d5b0c9096377bf4c89d0de043dec805
Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
Date: 2025-04-25 (Fri, 25 Apr 2025)
Changed paths:
M mlir/utils/generate-test-checks.py
Log Message:
-----------
[mlir][utils] Update generate-test-checks.py (use SSA names) (#136819)
This patch updates generate-test-checks.py to preserve original SSA
names (capitalized) when generating LIT variable names for function
arguments (i.e. for `CHECK-SAME` lines). This improves readability and
helps maintain consistency between the input MLIR and the expected
FileCheck/LIT output.
For example, given the following function:
```mlir
func.func @example(
%input: memref<4x6x3xf32>,
%filter: memref<1x3x8xf32>,
%output: memref<4x2x8xf32>) {
linalg.conv_1d_nwc_wcf
{dilations = dense<1> : tensor<1xi64>, strides = dense<3> : tensor<1xi64>}
ins(%input, %filter : memref<4x6x3xf32>, memref<1x3x8xf32>)
outs(%output : memref<4x2x8xf32>)
return
}
```
The generated output becomes:
```mlir
// CHECK-LABEL: func.func @conv1d_nwc_4x2x8_memref(
// CHECK-SAME: %[[INPUT:.*]]: memref<4x6x3xf32>,
// CHECK-SAME: %[[FILTER:.*]]: memref<1x3x8xf32>,
// CHECK-SAME: %[[OUTPUT:.*]]: memref<4x2x8xf32>) {
// CHECK: linalg.conv_1d_nwc_wcf
// CHECK: {dilations = dense<1> : tensor<1xi64>, strides = dense<3> : tensor<1xi64>}
// CHECK: ins(%[[INPUT]], %[[FILTER]] : memref<4x6x3xf32>, memref<1x3x8xf32>)
// CHECK: outs(%[[OUTPUT]] : memref<4x2x8xf32>)
// CHECK: return
// CHECK: }
```
By contrast, the current version of the script would generate:
```mlir
// CHECK-LABEL: func.func @conv1d_nwc_4x2x8_memref(
// CHECK-SAME: %[[VAL_0:.*]]: memref<4x6x3xf32>,
// CHECK-SAME: %[[VAL_1:.*]]: memref<1x3x8xf32>,
// CHECK-SAME: %[[VAL_2:.*]]: memref<4x2x8xf32>) {
// CHECK: linalg.conv_1d_nwc_wcf
// CHECK: {dilations = dense<1> : tensor<1xi64>, strides = dense<3> : tensor<1xi64>}
// CHECK: ins(%[[VAL_0]], %[[VAL_1]] : memref<4x6x3xf32>, memref<1x3x8xf32>)
// CHECK: outs(%[[VAL_2]] : memref<4x2x8xf32>)
// CHECK: return
// CHECK: }
```
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