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

[RISCV] Update matchSplatAsGather to convert vectors if they have different sizes #117878

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mikhailramalho
Copy link
Member

@mikhailramalho mikhailramalho commented Nov 27, 2024

No description provided.

This patch changes matchSplatAsGather to use vrgather no only when we
see an EXTRACT_VECTOR_ELT but also for RISCVISD::VMV_X_S.
Copy link

github-actions bot commented Nov 27, 2024

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

Signed-off-by: Mikhail R. Gadelha <[email protected]>
Signed-off-by: Mikhail R. Gadelha <[email protected]>
@lukel97
Copy link
Contributor

lukel97 commented Nov 27, 2024

I think the title needs updated, this is just modifying the matchSplatAsGather combine right?

Signed-off-by: Mikhail R. Gadelha <[email protected]>
; CHECK-NEXT: vrgather.vi v11, v9, 7
; CHECK-NEXT: vmseq.vv v11, v8, v11
; CHECK-NEXT: vmor.mm v10, v10, v11
; CHECK-NEXT: vrgather.vi v11, v9, 8
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 8 here is past VLMAX for this vector, so I think this will just splat 0 per the spec:

The source vector can be read at any index < VLMAX regardless of vl.

If an element index is out of range ( vs1[i] ≥ VLMAX ) then zero is returned for the element value.

The minimum vlen is 128, the SEW is 8 and LMUL=MF2, so VLMAX = 128 / 8 / 2 = 8. I think we need to check that Vec fits inside VT and bail if it doesn't

@mikhailramalho mikhailramalho changed the title [RISCV] Use vrgather in llvm.experimental.vector.match [RISCV] Update matchSplatAsGather to convert vectors if they have different sizes Nov 27, 2024
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