Skip to content

[MachineVerifier] Improve checks for G_INSERT_SUBVECTOR. #109209

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 2 commits into from
Sep 19, 2024

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented Sep 18, 2024

Cleanup messages.
Remove redundant checks that are handled in generic code.
Add overrun check.
Add checks that subvector is smaller than the vector.

Cleanup messages.
Remove redundant checks that are handled in geneirc code.
Add overrun check.
Add checks that subvector is smaller than the vector.
Copy link

github-actions bot commented Sep 18, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@@ -11,9 +11,11 @@ body: |
%1:_(<vscale x 2 x s32>) = G_IMPLICIT_DEF
%2:_(<vscale x 1 x s32>) = G_IMPLICIT_DEF

; CHECK: generic instruction must use register operands
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to say generic instruction must use register operands? looks unrelated

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

anything that has a type declared in the .td automatically generates a check that the operand is a register. This handles a significant portion of the generic instructions like G_ADD, G_FADD without writing any custom code.

I was going to remove the error from G_INSERT_SUBVECTOR and G_EXTRACT_SUBVECTOR, but we need the call to isReg() to avoid an assert in getReg() later. The assert will crash the test without letting us get through all the test cases.

Copy link
Contributor

@michaelmaitland michaelmaitland left a comment

Choose a reason for hiding this comment

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

LGTM

@topperc topperc merged commit 009398b into llvm:main Sep 19, 2024
8 checks passed
@topperc topperc deleted the pr/verify-insert-subvec branch September 19, 2024 01:31
tmsri pushed a commit to tmsri/llvm-project that referenced this pull request Sep 19, 2024
-Improve messages.
-Remove redundant checks that are handled in generic code.
-Add check that the subvector is smaller than the vector.
-Add checks that subvector is smaller than the vector.
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