[llvm] update_test_checks: improve IR value name stability (PR #110940)

Jannik Silvanus via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 03:14:46 PDT 2024


Nicolai =?utf-8?q?Hähnle?= <nicolai.haehnle at amd.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/110940 at github.com>


https://github.com/jasilvanus commented:

Thanks for this improvement!

> FWIW I don't think this functionality actually works in practice. I get the same amount of "rename diffs" before and after this feature was introduced. Does it only work for some specific UTC --version and not any of the older tests, or something like that?

For me it mostly worked nicely in practice, and sometimes failed (sometimes even introducing extra diff), which I suspect to be caused by the issue improved in this PR. I think it's always enabled by default independent of the version, but maybe only for IR tests?

The diff on the new test looks good.
For convenience, this is how the diff on `stable_ir_values5.ll` would have appeared in a PR:
Before: https://github.com/llvm/llvm-project/commit/c7e1732aafa48895856f3c08c5e6b5b61b584fea
After: https://github.com/llvm/llvm-project/commit/f24b14b817e392364c835815fb86e36d9c571430

Maybe we should put in a comment that briefly explains the idea of the algorithm? Something like:
```
# We want to determine a large set of compatible candidates, because this leads
# to a small diff. This is equivalent to interpreting the candidates as vertices in a 
# conflict graph, adding edges between incompatible candidates, and searching
# for a large independent set.
# Greedily selecting candidates and removing incompatible ones has the disadvantage
# that making few bad decisions early on can have huge consequences.
# Instead, we compute multiple (as few as possible) independent sets, putting every
# candidate in exactly one of the independent sets. Then, we select the largest independent
# set found, commit to all candidates in it, and recurse.
# This is equivalent to finding a coloring of the conflict graph.  
```

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


More information about the llvm-commits mailing list