[PATCH] D98479: [RISCV] Add DAG combine to optimize vXi64 all ones/zeros fixed vector on RV32.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 22:30:35 PST 2021


craig.topper created this revision.
craig.topper added a reviewer: frasercrmck.
Herald added subscribers: vkmr, 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.
craig.topper requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

vXi64 build_vectors are converted to v2Xi32 during type legalization
on RV32. This causes the use of SEW=32 splat instead of SEW=64.

This patch adds a DAG combine to detect the bitcasted pattern
and turn it into a SEW=64 splat.

We could maybe fix this in type legalization, but I'm not sure
we want to lose all zeroes/ones vector knowledge that early since
it's used by negate and not idioms for example.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98479

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98479.330148.patch
Type: text/x-patch
Size: 11551 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210312/93a9a09f/attachment-0001.bin>


More information about the llvm-commits mailing list