diff options
author | Andrzej WarzyĆski <andrzej.warzynski@arm.com> | 2025-04-25 17:20:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-25 17:20:04 +0100 |
commit | 7ff3d3bd1d5b0c9096377bf4c89d0de043dec805 (patch) | |
tree | 4291ddb94612fa81010b92375d9c0c5ca1ac648b /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | bd4a7aa64a79ee62b81f13ba7c45697ace386220 (diff) | |
download | llvm-7ff3d3bd1d5b0c9096377bf4c89d0de043dec805.zip llvm-7ff3d3bd1d5b0c9096377bf4c89d0de043dec805.tar.gz llvm-7ff3d3bd1d5b0c9096377bf4c89d0de043dec805.tar.bz2 |
[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: }
```
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions