diff options
author | Luke Lau <luke@igalia.com> | 2024-07-09 12:12:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-09 12:12:02 +0800 |
commit | 3f83a69bcb2c6b5fa3efbc41d1822e6fa69a6620 (patch) | |
tree | a5f597d4c5f3a31e6cc214be9ae787c105c986e6 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | d0f3943a027347685905080f6f5ee423b1c8714a (diff) | |
download | llvm-3f83a69bcb2c6b5fa3efbc41d1822e6fa69a6620.zip llvm-3f83a69bcb2c6b5fa3efbc41d1822e6fa69a6620.tar.gz llvm-3f83a69bcb2c6b5fa3efbc41d1822e6fa69a6620.tar.bz2 |
[RISCV] Allow folding vmerge into masked ops when mask is the same (#97989)
We currently only fold a vmerge into a masked true operand if the vmerge
has an all-ones mask, since we end up keeping the mask from the true
operand.
But if the masks are the same then we can still fold, because vmerge and
true have the same passthru. If an element was masked off in the
original vmerge, it will also be masked off in the resulting true, and
will have the same passthru value.
The motivation for this is to lower masked VP loads and stores with
passthrus to masked RVV instructions. Normally you can express a masked
RVV instruction with a mask undisturbed passthru via a combination of a
VP op with an all-ones mask and a vp.merge. But for loads and stores you
need the same mask on the VP op as well as the vp.merge.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions