[PATCH] D139100: Add update_any_test_checks.py convenience utility

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 08:40:52 PST 2022


arichardson added a comment.

In D139100#3963822 <https://reviews.llvm.org/D139100#3963822>, @nhaehnle wrote:

> Thank you for the quick review! I will give yapf a try.
>
>> I always run update_llc_test_checks.py with --llc-binary=... and update_test_checks.py with --opt-binary=... How does this new tool support that? Or do I need to change my workflow?
>
> It doesn't support it at the moment. In my local setup, I source an environment that has all the tools in its PATH. I find that more convenient for other reasons, so didn't try to figure out how to make the alternative work.
>
>> Also, probably out of scope for this patch, but does it handle files that have checks generated by two or more tools, like test/CodeGen/AMDGPU/infinite-loop.ll?
>
> Huh, interesting. I think what we'd want to do is to run all the UTC tools in sequence, from the same executor submit. I played around with this just now, and it looks like the tools don't reliably update the header notes about autogenerated tests. So I'd keep that as a separate change if desired.

I think one of the problems is that tools refuse to update if there is no comment/a comment from another tool unless you pass the `--force-update` flag to ignore that.

IMO it would be nice if we had a single script to update everything (at least for _test_checks/llc_test_checks/cc_test_checks, not sure about the analyzer/mir ones since this scripts share less code).

In D139100#3963298 <https://reviews.llvm.org/D139100#3963298>, @foad wrote:

> Great idea.
>
> I always run update_llc_test_checks.py with --llc-binary=... and update_test_checks.py with --opt-binary=... How does this new tool support that? Or do I need to change my workflow?

One option would be to forward those arguments - maybe all tools should just accept those flags and ignore them if the tool is not used (or --llvm-bin). Another alternative would be to generate a script inside the build dir and then you can run `<buil-dir>/utils/update_any_test_checks <path to dir>`. I did something like that for the crash testcase reduction tool in CHERI LLVM: https://github.com/CTSRD-CHERI/llvm-project/blob/master/clang/utils/creduce_crash_testcase.py.in


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139100/new/

https://reviews.llvm.org/D139100



More information about the llvm-commits mailing list