This is an archive of the discontinued LLVM Phabricator instance.

[update_llc_test_checks] Use FileCheck captures for MCInst/MCReg output
ClosedPublic

Authored by arichardson on May 10 2022, 4:44 AM.

Details

Summary

To avoid test churn when backends add/rename new instructions/registers,
it makes sense to use FileCheck captures for the exact MCInst/Reg number.
This is motivated by D125307, where I use --asm-show-inst to differentiate
the output for multiple instructions with the same mnemonic.

This does not quite fix the churn issue yet: While files with the generated
checks will be immune to the numbers changing, the update script test
still suffers from this problem since the number is encoded in the
FileCheck variable name. I plan to address this in a follow-up patch.

Diff Detail

Event Timeline

arichardson created this revision.May 10 2022, 4:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2022, 4:44 AM
arichardson published this revision for review.May 10 2022, 5:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2022, 5:08 AM

This makes sense. There is one functionality loss: the check lines no line assert that two register numbers are identical and therefore cannot detect some bugs.

Use FileCheck captures instead to ensure registers are matched

arichardson retitled this revision from [update_llc_test_checks] Scrub MCInst numbers with --asm-show-inst to [update_llc_test_checks] Use FileCheck captures for MCInst/MCReg output.May 11 2022, 10:24 AM
arichardson edited the summary of this revision. (Show Details)
MaskRay accepted this revision.May 11 2022, 10:34 AM

LGTM.

This revision is now accepted and ready to land.May 11 2022, 10:34 AM
This revision was landed with ongoing or failed builds.May 14 2022, 7:43 AM
This revision was automatically updated to reflect the committed changes.