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

Fix #8455 (in combination with #8457) #8456

Merged
merged 2 commits into from
Nov 6, 2024
Merged

Fix #8455 (in combination with #8457) #8456

merged 2 commits into from
Nov 6, 2024

Conversation

steven-johnson
Copy link
Contributor

In slice_vector(), only check for type equality after vectors have been normalized to fixed (i.e., it's ok for some original input to be vscale)

In slice_vector(), only check for type equality after vectors have been normalized to fixed (i.e., it's ok for some original input to be vscale)
@steven-johnson
Copy link
Contributor Author

steven-johnson commented Nov 5, 2024 via email

@zvookin
Copy link
Member

zvookin commented Nov 5, 2024

(I deleted a prev comment that was just wrong)

I think the intent is the types need to match, but the result is always fixed so... sigh. Also if we're going to conform the types to each other, we might as well broadcast scalars to match a vector if the other argument is one. Would be nice if we had a specification... I feel like the idea of making LLVM IR level routines easier to use by automatically fixing up types ends up being less productive because something ends up not being what one expects which either messes up semantics somewhere of triggers an assert elsewhere. But we do generally broadcast scalars to vectors as needed so...

Let me see if there's a reliable way to get the inputs to strictly match types.

@zvookin
Copy link
Member

zvookin commented Nov 6, 2024

I've convinced myself that this is the correct fix in that the result type is always a fixed vector and the conversions are from scalable to fixed. This allows one to compose shuffle_vectors calls without manually converting all scalable vectors to fixed ones. Which is what is happening here: in interleave_vectors, with an odd number of vectors, if they are all scalable, the last one will be shuffled with a fixed vector returned from a previous shuffle.

Conversion from scalable to fixed is lossless and always changes the flavor. (Fixed vectors with length that is not divisible by the effective vscale cannot be converted and stay fixed.) Thus my take is this will uniformly improve reliability without introducing new type mismatches.

@steven-johnson steven-johnson changed the title Partial fix for #8455 Fix #8455 (in combination with #8457) Nov 6, 2024
@steven-johnson steven-johnson merged commit a1723e7 into main Nov 6, 2024
3 checks passed
@steven-johnson steven-johnson deleted the srj/rvv branch November 6, 2024 19:42
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