[llvm] [UTC] Add utility script to deal with conflicting RUN lines (PR #182546)

Henrik G. Olsson via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 23:14:08 PDT 2026


hnrklssn wrote:

Since there aren't any test cases (should there be?), I'll ask to be sure: does this do structural diffing for captured variables, so that they can be merged even if the names differ?
Sometimes when generating clang codegen tests with RUN lines they generate slightly different metadata, and thus the matchers end up naming the captured variables for metadata differently, so UTC thinks the checks clash if they share a prefix. But the generated checks actually match both outputs. My workflow in these cases is normally to temporarily disable one RUN line, regenerate, and then reenable the RUN line.

To make what I'm asking more concrete, here's an example:
Imagine the first RUN line emits these checks:
```
; CHECK_A: [[TMP2:%.*]] = add i64 [[TMP0]] [[TMP1]], some_metadata [[META5:!.*]]
; CHECK_A: [[META5]] = %{}
```
and the second RUN line emits these checks:
```
; CHECK_B: [[TMP3:%.*]] = add i64 [[TMP0]] [[TMP1]], some_metadata [[META8:!.*]]
; CHECK_B: [[META8]] = %{}
```

The actual emitted IR from both RUN lines, even if slightly different, would still match either set of checks. Would this be able to merge them?

Separately: should we update the auto-updater in lit so that it automatically invokes the merge script when updating UTC tests?

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


More information about the llvm-commits mailing list