[PATCH] D137106: [RISCV] Fix crash a vector add has a 4x sext and zext operand.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 12:44:10 PDT 2022


craig.topper created this revision.
craig.topper added reviewers: qcolombet, reames.
Herald added subscribers: sunshaoce, VincentWu, StephenFan, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

We can narrow one of the extends and keep the other original by
using a vwaddu.wv or vwadd.wv.

We were previously forgetting to keep the original operand and
instead took the source of its extend. This resulted in a type
mismatch that later failed with an impossible physical register copy.

To fix this I've refactored some code to maintain information about
whether the source needs to be extended at all for longer so we could
use it in materialize.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137106

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vwaddu.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137106.472105.patch
Type: text/x-patch
Size: 4686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221031/94afd576/attachment.bin>


More information about the llvm-commits mailing list