[llvm] update_test_checks: match IR basic block labels (PR #88979)

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 17 03:28:42 PDT 2024


nhaehnle wrote:

> > Aside from that, the key challenge is that block labels are values, and we typically capture values including the prefix '%'. However, when labels appear at the start of a basic block, the prefix '%' is not included, so we must capture block label values without the prefix '%'.
> 
> Just to throw it out there: Might it make sense to generally _not_ include the prefix `%` in version 5? That is, use `%[[FOO:.*]]` instead of `[[FOO:%.*]]`?

I vaguely recall thinking about this way back when I wrote the first version of this change. It will lead to check lines like:
```
  %[[TMP10:.*]] = add i32 %[[TMP4]], %[[TMP5]]
```
... where today we have ...
```
  [[TMP10:%.*]] = add i32 [[TMP4]], [[TMP5]]
```
I don't feel very strongly about it, but I prefer the second version (i.e., keep it as-is) because the right-hand side has less visual noise.

https://github.com/llvm/llvm-project/pull/88979


More information about the llvm-commits mailing list