This is an archive of the discontinued LLVM Phabricator instance.

update_mir_test_checks: Better handling of common prefixes
ClosedPublic

Authored by nhaehnle on May 25 2022, 12:51 PM.

Details

Summary

Support the pattern where a test file uses multiple prefixes per run line:
one prefix that is unique to the run line, and additional prefixes that are
common with other run lines.

Decide on a per-function basis which prefix(es) to emit, based on which run
lines have the same output.

Move the renaming of vregs earlier, so that we can compare the output as it
would actually be printed in check lines.

Diff Detail

Event Timeline

nhaehnle created this revision.May 25 2022, 12:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 12:51 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
nhaehnle requested review of this revision.May 25 2022, 12:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 12:51 PM
Herald added a subscriber: wdng. · View Herald Transcript

This looks reasonable to me, would it be possible to add a test showing the new behaviour?

This looks reasonable to me, would it be possible to add a test showing the new behaviour?

Yeah, I was wondering about that as well. Do you have any advice on how to do that? I didn't find any pre-existing tests, and it seems somewhat tricky to set up given that it's subject to changes in the code generator.

This looks reasonable to me, would it be possible to add a test showing the new behaviour?

Yeah, I was wondering about that as well. Do you have any advice on how to do that? I didn't find any pre-existing tests, and it seems somewhat tricky to set up given that it's subject to changes in the code generator.

There is one mir test: https://github.com/llvm/llvm-project/tree/main/llvm/test/tools/UpdateTestChecks/update_mir_test_checks
I agree these tests are rather awkward since they depend on the codegen, but as long as they are simple there shouldn't be too many changes.

nhaehnle updated this revision to Diff 432598.May 27 2022, 10:16 AM

Add a simple test case

arsenm accepted this revision.May 27 2022, 1:36 PM

Thanks for finally doing this. This has wasted countless hours and is long overdue

llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
3

Using -stop-after=instruction-select without -global-isel only works by accident. Probably should pick a different stopping point

This revision is now accepted and ready to land.May 27 2022, 1:36 PM
aemerson added inline comments.May 27 2022, 2:56 PM
llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
3

Yeah, the right one is probably finalize-isel

nhaehnle marked 2 inline comments as done.Jun 1 2022, 1:52 PM
nhaehnle added inline comments.
llvm/test/tools/UpdateTestChecks/update_mir_test_checks/Inputs/x86-multiple-prefixes.ll.expected
3

Yeah, the right one is probably finalize-isel

Thanks, I'm adjusting the test before I push.

This revision was landed with ongoing or failed builds.Jun 1 2022, 1:53 PM
This revision was automatically updated to reflect the committed changes.
nhaehnle marked an inline comment as done.