[all-commits] [llvm/llvm-project] b228a1: [mlir] Use MLIR op names when generating FileCheck...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Tue Oct 14 05:25:48 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b228a18e572ac7ab7a2f61b97c0a2dd3565a8201
      https://github.com/llvm/llvm-project/commit/b228a18e572ac7ab7a2f61b97c0a2dd3565a8201
  Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
  Date:   2025-10-14 (Tue, 14 Oct 2025)

  Changed paths:
    M mlir/utils/generate-test-checks.py

  Log Message:
  -----------
  [mlir] Use MLIR op names when generating FileCheck variables in generate-test-checks.py (#160820)

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.



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