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][LLT] Add isFixedVector and isScalableVector #71713

Merged

Conversation

michaelmaitland
Copy link
Contributor

The current isScalable function requires a user to call isVector before hand in order to avoid an assertion failure in the case that the LLT is not a vector.

This patch addds helper functions that allow a user to query whether the LLT is fixed or scalable, not wanting an assertion failure in the case that the LLT was never a vector in the first place.

The current isScalable function requires a user to call isVector before
hand in order to avoid an assertion failure in the case that the LLT is
not a vector.

This patch addds helper functions that allow a user to query whether the
LLT is fixed or scalable, not wanting an assertion failure in the case
that the LLT was never a vector in the first place.
@arsenm
Copy link
Contributor

arsenm commented Nov 9, 2023

The current isScalable function requires a user to call isVector before hand in order to avoid an assertion failure in the case that the LLT is not a vector.

I'd consider that a bug in the first place. It shouldn't assert

@michaelmaitland
Copy link
Contributor Author

I'd consider that a bug in the first place. It shouldn't assert

The docstring specifies a precondition that the LLT is a vector type. So by asserting, it is checking that precondition, which does not seem like a bug. However, I do wonder if we can drop this precondition so we can drop the assert.

@michaelmaitland michaelmaitland merged commit bede010 into llvm:main Nov 9, 2023
4 checks passed
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
The current isScalable function requires a user to call isVector before
hand in order to avoid an assertion failure in the case that the LLT is
not a vector.

This patch addds helper functions that allow a user to query whether the
LLT is fixed or scalable, not wanting an assertion failure in the case
that the LLT was never a vector in the first place.
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.

None yet

2 participants