[PATCH] D42805: [utils] Refactor utils/update_{, llc_}test_checks.py to share more code
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 2 15:00:35 PST 2018
MaskRay added a comment.
In https://reviews.llvm.org/D42805#996534, @spatel wrote:
> In https://reviews.llvm.org/D42805#996490, @MaskRay wrote:
>
> > If you prefer different scripts for different purposes:
> >
> > utils/update_opt_test_checks.py input: LLVM IR ; CHECK lines: LLVM IR
> > utils/update_llc_test_checks.py input: LLVM IR ; CHECK lines: assembly
> > utils/update_cc_test_checks.py input: C/C++/ObjC/.. ; CHECK lines: assembly or LLVM IR
> >
> >
> > If you did not mind merging `update_test_checks.py` and `update_llc_test_checks.py`, we could rename and merge these scripts by their input format:
> >
> > utils/update_ir_test_checks.py input: LLVM IR ; CHECK lines: assembly or LLVM IR
> > utils/update_cc_test_checks.py input: LLVM IR ; CHECK lines: assembly or LLVM IR
> >
> >
> > Instead of just script name on the `ADVERT` line, we could also put an extra option to indicate its usage e.g.:
> >
> > ; NOTE: Assertions have been autogenerated by utils/update_ir_test_checks.py --llc
> > ; NOTE: Assertions have been autogenerated by utils/update_ir_test_checks.py --opt
> >
> >
> > `--llc` and `--opt` restrict the script to update `; RUN` lines that use the two tools, respectively. By merging the two scripts, we can reduce more boilerplate.
> >
> > I can do that in another revision (after this revision and https://reviews.llvm.org/D42712 are landed)
>
>
> One script with an option to choose the output format sounds good to me.
>
> Note that we do have some regression tests where we check both IR and asm in one file, so make sure that case still works. Recent example is in https://reviews.llvm.org/D42607 - test/Transforms/LoopStrengthReduce/X86/macro-fuse-cmp.ll
It still works
~/Dev/llvm/utils/update_llc_test_checks.py -v --llc-binary=~/Dev/llvm/release/bin/llc test/Transforms/LoopStrengthReduce/X86/macro-fuse-cmp.ll
# No change
~/Dev/llvm/utils/update_test_checks.py -v --opt-binary=~/Dev/llvm/release/bin/opt test/Transforms/LoopStrengthReduce/X86/macro-fuse-cmp.ll
# There are expected changes. After all the ADVERT line is update_llc_test_checks.py
Repository:
rL LLVM
https://reviews.llvm.org/D42805
More information about the llvm-commits
mailing list