Skip to content

[MachineVerifier] Improve G_EXTRACT_SUBVECTOR checking #109202

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

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented Sep 18, 2024

Check that the destination of G_EXTRACT_SUBVECTOR is smaller than the source.
Fix wording of error messages

@@ -1793,8 +1799,7 @@ void MachineVerifier::verifyPreISelGenericInstruction(const MachineInstr *MI) {
}

uint64_t SrcMinLen = SrcTy.getElementCount().getKnownMinValue();
if (SrcTy.isScalable() == DstTy.isScalable() &&
(Idx >= SrcMinLen || Idx + DstMinLen > SrcMinLen)) {
if ((Idx >= SrcMinLen || Idx + DstMinLen > SrcMinLen)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can drop () pair

@topperc topperc changed the title [MachineVerifier] Check that the destination of G_EXTRACT_SUBVECTOR is smaller than the source. [MachineVerifier] Improve G_EXTRACT_SUBVECTOR checking Sep 18, 2024
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 e494e2a into llvm:main Sep 19, 2024
8 checks passed
@topperc topperc deleted the pr/verify-extract branch September 19, 2024 01:29
tmsri pushed a commit to tmsri/llvm-project that referenced this pull request Sep 19, 2024
Check that the destination of G_EXTRACT_SUBVECTOR is smaller than the
source. Improve wording of error messages.
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