This is an archive of the discontinued LLVM Phabricator instance.

[UpdateTestChecks] Add UTC_ARGS support for update_{llc,cc}_test_checks.py
ClosedPublic

Authored by arichardson on Apr 20 2020, 2:02 AM.

Details

Summary

https://reviews.llvm.org/D69701 added support for on-the-fly argument
changes for update scripts. I recently wanted to keep some manual check
lines in a test generated by update_cc_test_checks.py in our CHERI fork, so
this commit adds support for UTC_ARGS in update_cc_test_checks.py. And since
I was refactoring the code to be in common.py, I also added it for
update_llc_test_checks.py.

Diff Detail

Event Timeline

arichardson created this revision.Apr 20 2020, 2:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2020, 2:02 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I feel there is a lot of good stuff here but it seems to mix two things. A rewrite of the script infrastructure and the UTC_ARGS stuff. If so, do you think we could split them? I feel there are also minor NFC changes that could go in on their own without review, I marked on of them below.

(Partially related: Does this handle the mismatch between enabled configuration status and the flag names enable/disable or will it still add --enabled to the UTC_ARGS?)

llvm/utils/update_cc_test_checks.py
122

I guess these 7 lines can be committed on their own as NFC cleanup.

I feel there is a lot of good stuff here but it seems to mix two things. A rewrite of the script infrastructure and the UTC_ARGS stuff. If so, do you think we could split them? I feel there are also minor NFC changes that could go in on their own without review, I marked on of them below.

(Partially related: Does this handle the mismatch between enabled configuration status and the flag names enable/disable or will it still add --enabled to the UTC_ARGS?)

It will now read the command line flag that was specified when calling parser.add_argument() and should do the right thing.

I'll split out the unrelated changes to separate reviews.

Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2020, 4:55 AM
jdoerfert accepted this revision.Jul 2 2020, 9:27 AM

Nice cleanup again!

I think eventually we need to teach the common logic to recognize top-level entities, e.g., functions, and with these changes it will be accessible w/o duplication in all update scripts, YaY!

This revision is now accepted and ready to land.Jul 2 2020, 9:27 AM

The idea look good to me, but I want some opinions on the name UTC_ARGS (I can't help associating it with Coordinated Universal Time). Adding some folks who may have opinions: @greened @lebedev.ri @RKSimon @spatel @xbolva00

UTC_ARGS (I can't help associating it with Coordinated Universal Time).

Me too. Any suggestions for new name? TCU_ARGS?

The idea look good to me, but I want some opinions on the name UTC_ARGS (I can't help associating it with Coordinated Universal Time). Adding some folks who may have opinions: @greened @lebedev.ri @RKSimon @spatel @xbolva00

I agree that UTC_ARGS could be a bit confusing. However, there are currently 145 UTC_ARGS uses in tests/Transforms and I'd rather not update them as part of this change.

I feel that changing the name should be a separate change that can be committed after this patch.

The idea look good to me, but I want some opinions on the name UTC_ARGS (I can't help associating it with Coordinated Universal Time). Adding some folks who may have opinions: @greened @lebedev.ri @RKSimon @spatel @xbolva00

I agree that UTC_ARGS could be a bit confusing. However, there are currently 145 UTC_ARGS uses in tests/Transforms and I'd rather not update them as part of this change.

I feel that changing the name should be a separate change that can be committed after this patch.

Yes, please. The name is my fault, but naming things is hard :(

@MaskRay If you have an alternative name, I propose a sed -e/UTC_ARGS/.../ patch, maybe with a check in here warning if UTC_ARGS is used.

spatel added a comment.Jul 2 2020, 1:55 PM

UTC_ARGS (I can't help associating it with Coordinated Universal Time).

Me too. Any suggestions for new name? TCU_ARGS?

I also reflexively think of universal time when reading "UTC". I think we always print this with the script name advertisement line, so "SCRIPT_ARGS" seems non-ambiguous.

@MaskRay are you okay with me committing this change and delaying the global search-replace?

MaskRay accepted this revision.Jul 7 2020, 12:26 PM

LGTM.