Skip to content
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

[CodeGen][MIR] Support parsing of scalable vectors in MIR #70893

Merged
merged 5 commits into from
Nov 3, 2023

Conversation

michaelmaitland
Copy link
Contributor

This patch builds on the support for vectors by adding ability to parse scalable vectors in MIR.

lex();
}

auto GetError = [this, &HasVScale, Loc]() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you capture Loc by value here, I don't think it update when lex() is called. So the location will be stale.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh nevermind. Loc is passed as an argument and not coming from lex().

Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

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

lgtm with nit

if (HasVScale)
return error(
Loc, "expected <vscale x M x sN> or <vscale M x pA> for vector type");
else
Copy link
Contributor

Choose a reason for hiding this comment

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

No return after else

@michaelmaitland michaelmaitland merged commit 801a30a into llvm:main Nov 3, 2023
2 of 3 checks passed
michaelmaitland added a commit that referenced this pull request Nov 7, 2023
#70881)

…gSizeInBits

This patch changes getRegSizeInBits to return a TypeSize instead of an
unsigned in the case that a virtual register has a scalable LLT. In the
case that register is physical, a Fixed TypeSize is returned.

The MachineVerifier pass is updated to allow copies between fixed and
scalable operands as long as the Src size will fit into the Dest size.

This is a precommit which will be stacked on by a change to GISel to
generate COPYs with a scalable destination but a fixed size source.

This patch is stacked on #70893
for the ability to use scalable vector types in MIR tests.
qihangkong pushed a commit to rvgpu/llvm that referenced this pull request Apr 18, 2024
…… (#70881)

…gSizeInBits

This patch changes getRegSizeInBits to return a TypeSize instead of an
unsigned in the case that a virtual register has a scalable LLT. In the
case that register is physical, a Fixed TypeSize is returned.

The MachineVerifier pass is updated to allow copies between fixed and
scalable operands as long as the Src size will fit into the Dest size.

This is a precommit which will be stacked on by a change to GISel to
generate COPYs with a scalable destination but a fixed size source.

This patch is stacked on llvm/llvm-project#70893
for the ability to use scalable vector types in MIR tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants