This is an archive of the discontinued LLVM Phabricator instance.

[NFC] factor update test function test builder as a class
ClosedPublic

Authored by mtrofin on Dec 16 2020, 11:12 AM.

Details

Summary

This allows us to have shared logic over multiple test runs, e.g. do we
have unused prefixes, or which function bodies have conflicting outputs
for a prefix appearing in different RUN lines.

This patch is just wrapping existing functionality, and replacing its uses.
A subsequent patch would then fold the current functionality into the newly
introduced class.

Diff Detail

Event Timeline

mtrofin created this revision.Dec 16 2020, 11:12 AM
mtrofin requested review of this revision.Dec 16 2020, 11:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 16 2020, 11:12 AM
pengfei added inline comments.Dec 16 2020, 6:07 PM
llvm/utils/UpdateTestChecks/common.py
351

When is close called?

llvm/utils/update_cc_test_checks.py
249–255

I think we can put this code into the class initialization.

251

I think we just need to pass ti.args here. Together with above, it can be simplied to

builder = common.FunctionTestBuilder(run_list, ti.args)
llvm/utils/update_llc_test_checks.py
126

This argument duplicated with class members.

mtrofin marked 4 inline comments as done.Dec 16 2020, 8:09 PM
mtrofin added inline comments.
llvm/utils/UpdateTestChecks/common.py
351

never - thanks for the catch

llvm/utils/update_cc_test_checks.py
251

that almost worked seamlessly, llc_tests had a different args object, but easy fix. Less unpacking/repacking parameters overall.

llvm/utils/update_llc_test_checks.py
126

not in all cases though. in fact, all but update_llc_test_checks have it []. I'll pass it in the ctor though.

mtrofin updated this revision to Diff 312365.Dec 16 2020, 8:09 PM
mtrofin marked 3 inline comments as done.

update

pengfei accepted this revision.Dec 16 2020, 8:38 PM

LGTM.

This revision is now accepted and ready to land.Dec 16 2020, 8:38 PM
This revision was landed with ongoing or failed builds.Dec 16 2020, 9:21 PM
This revision was automatically updated to reflect the committed changes.