Skip to content

Make some tablegen tests more flexible. #97651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

wolfy1961
Copy link
Collaborator

Some organizations have added operators downstream, and the 3 tests in this PR tend to fail with off-by-n errors (with n being the number of added operators) periodically.
To alleviate this. the proposed change is taking advantage of the fact that the 2nd and 3rd element in a switch table represent the lower and upper bounds of the operator id, and that the offset of the first byte of the encoded operations is a function of these 2 bounds.
Additionally, we the default label offset is encoded in a FileCheck variable.

@wolfy1961 wolfy1961 requested review from kovdan01 and Pierre-vh July 3, 2024 22:48
Copy link
Contributor

@Pierre-vh Pierre-vh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Do they fail sporadically, or are they just annoying to update?
I'm wondering if we could write a small script to autogenerate the checks at some point, similar to update_test_checks

@wolfy1961
Copy link
Collaborator Author

LGTM

Do they fail sporadically, or are they just annoying to update? I'm wondering if we could write a small script to autogenerate the checks at some point, similar to update_test_checks

They're not flaky, just annoying to update. The output from tblgen seems to be deterministic. A script sounds like a good idea, but I'm wondering how much it would have to know about the inner workings of tblgen or at least the details of the table layout.

Thanks for the review.

@wolfy1961 wolfy1961 merged commit 68a8ae0 into llvm:main Jul 8, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants