[PATCH] D103147: [SelectionDAG][RISCV] Don't unroll 0/1-type bool VSELECTs

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 26 03:28:23 PDT 2021


frasercrmck created this revision.
frasercrmck added reviewers: RKSimon, craig.topper, spatel.
Herald added subscribers: vkmr, ecnelises, 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.
frasercrmck requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

This patch extends the cases in which the legalizer is able to express
VSELECT in terms of XOR/AND/OR. When dealing with a VSELECT between
boolean vector types, the mask itself is an all-ones or all-ones value
of the operand type, so a 0/1 boolean type behaves identically to a 0/-1
type.

This greatly helps RISC-V which relies on expansion for these nodes. It
also allows scalable-vector bool VSELECTs to use the default expansion,
where before it would crash in SelectionDAG::UnrollVectorOp.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103147

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vselect.ll
  llvm/test/CodeGen/RISCV/rvv/vselect-mask.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103147.347887.patch
Type: text/x-patch
Size: 137140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210526/fc0f6cfd/attachment-0001.bin>


More information about the llvm-commits mailing list