You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mlir] Use MLIR op names when generating FileCheck variables in generate-test-checks.py
Motivation
----------
Improve readability and stability of autogenerated CHECK lines by using
operation-aware FileCheck variable names instead of generic VAL_N.
What changes
------------
- When possible, variable names are derived from the MLIR op name, e.g.
`vector.transfer_read` → `TRANSFER_READ_0`.
- Unknown ops (e.g., from out-of-tree dialects) fall back to the prior
`VAL_N` scheme.
Before
------
```mlir
// CHECK: %[[VAL_4:.*]] = vector.transfer_read ...
// CHECK: %[[VAL_5:.*]] = "val_use"(%[[VAL_4]]) : ...
```
After
-----
```mlir
// CHECK: %[[TRANSFER_READ_0:.*]] = vector.transfer_read ...
// CHECK: %[[VAL_1:.*]] = "val_use"(%[[TRANSFER_READ_0]]) : ...
```
Rationale
---------
Using op-derived names (e.g., `TRANSFER_READ_0`) makes tests easier to
read and audit, while remaining more stable across unrelated edits (e.g.
there will always be fewer `TRANSFER_READ_#N` variables than `VAL_#N`).
The fallback to `VAL_N` preserves compatibility for unknown ops.
0 commit comments