This is an archive of the discontinued LLVM Phabricator instance.

[update_(llc_)test_checks.py] Support pre-processing commands
ClosedPublic

Authored by arichardson on Jan 21 2021, 7:34 AM.

Details

Summary

This has been rather useful in our downstream CHERI target where we want
to run tests both with addrspace(0) and addrspace(200) pointers.
With this patch we can prefix the opt command with
sed -e 's/addrspace(200)/addrspace(0)/g' -e 's/-A200-P200-G200//g' to
test both cases using the same IR input.

Diff Detail

Event Timeline

arichardson created this revision.Jan 21 2021, 7:34 AM
arichardson retitled this revision from [update_test_checks] Support pre-processing commands to [update_(llc_)test_checks.py] Support pre-processing commands.Jan 22 2021, 2:40 AM
arichardson edited the summary of this revision. (Show Details)

Add tests and also allow it in update_llc_test_checks.py

arichardson published this revision for review.Jan 22 2021, 2:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2021, 2:42 AM
jdoerfert accepted this revision.Jan 22 2021, 7:40 AM

LGTM. Maybe wait a bit if someone else wants to take a look.

Now we also need to execute RUN lines without FileCheck and we are almost there ;)

This revision is now accepted and ready to land.Jan 22 2021, 7:40 AM

Is sed even allowed to be used in tests? Is it available in the required tool set?

Is sed even allowed to be used in tests? Is it available in the required tool set?

There are lots of uses in llvm/test/CodeGen/ for various architectures already.

Is sed even allowed to be used in tests? Is it available in the required tool set?

There are lots of uses in llvm/test/CodeGen/ for various architectures already.

Touché.
I'm uneasy about such tests, but the UpdateTestChecks is fine i guess.

rebase after latest changes

  • fix pre-processing test after output changes

Hi,

Doesn't look like this just handles --llc-binary command line argument of update_llc_test_checks.py correctly: I assume references to llc from within the preprocess_cmd should also be replaced with the value of --llc-binary if any, similarly to the substitution done for the main part of the command?

Thanks!

Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 4:55 PM
Herald added a subscriber: StephenFan. · View Herald Transcript

Unless there are any

Hi,

Doesn't look like this just handles --llc-binary command line argument of update_llc_test_checks.py correctly: I assume references to llc from within the preprocess_cmd should also be replaced with the value of --llc-binary if any, similarly to the substitution done for the main part of the command?

Thanks!

Yes that would be ideal (and shouldn't be too hard to implement), I just never had the need for that so far.