Skip to content

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.
lukel97 added a commit that referenced this pull request Jul 4, 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 #141885 and #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 dedicated
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