Skip to content

[RISCV] Add tests for vmadd for VP intrinsics. NFC #70042

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 1 commit into from
Oct 26, 2023

Conversation

lukel97
Copy link
Contributor

@lukel97 lukel97 commented Oct 24, 2023

We have VP tests for vmacc but not vmadd. This copies the vmacc tests but swaps
the false operand of vp.merge to be the multiplicand instead of the addend.

This shows how we could fold the vmerge into the vmadd's mask if we commuted %a
and %b.

We have VP tests for vmacc but not vmadd. This copies the vmacc tests but swaps
the false operand of vp.merge to be the multiplicand instead of the addend.

This shows how we could fold the vmerge into the vmadd's mask if we commuted %a
and %b.
@lukel97 lukel97 merged commit c285b7f into llvm:main Oct 26, 2023
@lukel97 lukel97 deleted the vmadd-vp-tests branch October 26, 2023 06:59
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Oct 26, 2023
We have VP tests for vmacc but not vmadd. This copies the vmacc tests
but swaps
the false operand of vp.merge to be the multiplicand instead of the
addend.

This shows how we could fold the vmerge into the vmadd's mask if we
commuted %a
and %b.
lukel97 added a commit to lukel97/llvm-project that referenced this pull request Jun 13, 2025
This moves the peephole that folds vmerges into its operands into RISCVVectorPeephole. This will also allow us to eventually commute instructions to allow folding, see llvm#141885 and llvm#70042

Most of the test diffs are due to the slight change in instruction ordering.

For now doPeepholeMaskedRVV is kept even though its a duplicate of RISCVVectorPeephole::convertToUnmasked to minimize the diff, I plan on removing it in a separate patch as it causes some instructions to be shuffled around.

Similarly, this runs foldVMergeToMask before the other peepholes to minimize the diff for now.

rvv-peephole-vmerge-vops-mir.ll was replaced with a dedicate vmerge-peephole.mir test.
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