[PATCH] D135600: [RISCV] Use branchless form for selects with 0 in either arm

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 09:18:42 PDT 2022


reames created this revision.
reames added reviewers: craig.topper, asb, frasercrmck.
Herald added subscribers: sunshaoce, VincentWu, armkevincheng, sjarus, eric-k256, StephenFan, 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, bollu, simoncook, johnrusso, rbar, hiraditya, kristof.beyls, arichardson, mcrosier.
Herald added a project: All.
reames requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

Continuing the theme of adding branchless lowerings for simple selects, this time handle the 0 arm case.  This is very common for various umin idioms, etc..


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135600

Files:
  llvm/lib/Target/RISCV/RISCVISelLowering.cpp
  llvm/test/CodeGen/RISCV/compress-opt-select.ll
  llvm/test/CodeGen/RISCV/double-convert.ll
  llvm/test/CodeGen/RISCV/float-convert.ll
  llvm/test/CodeGen/RISCV/fpclamptosat.ll
  llvm/test/CodeGen/RISCV/fpclamptosat_vec.ll
  llvm/test/CodeGen/RISCV/half-convert.ll
  llvm/test/CodeGen/RISCV/rv32zbb-zbkb.ll
  llvm/test/CodeGen/RISCV/rv32zbs.ll
  llvm/test/CodeGen/RISCV/rv64zbb.ll
  llvm/test/CodeGen/RISCV/rvv/ceil-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vector-fpext-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vector-fptrunc-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vector-trunc-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-ceil-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-floor-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fptosi-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fptoui-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-fp-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-int-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-mask-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-round-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-roundeven-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-roundtozero-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-setcc-fp-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-setcc-int-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-sext-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-sitofp-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpstore.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-uitofp-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vadd-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vcopysign-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfabs-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfma-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfmax-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfmin-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfmuladd-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfneg-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfsqrt-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vmax-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vmaxu-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vmin-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vminu-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpgather.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpload.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpmerge.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpscatter.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpstore.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vselect-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-zext-vp.ll
  llvm/test/CodeGen/RISCV/rvv/floor-vp.ll
  llvm/test/CodeGen/RISCV/rvv/round-vp.ll
  llvm/test/CodeGen/RISCV/rvv/roundeven-vp.ll
  llvm/test/CodeGen/RISCV/rvv/roundtozero-vp.ll
  llvm/test/CodeGen/RISCV/rvv/setcc-fp-vp.ll
  llvm/test/CodeGen/RISCV/rvv/setcc-int-vp.ll
  llvm/test/CodeGen/RISCV/rvv/strided-vpload.ll
  llvm/test/CodeGen/RISCV/rvv/strided-vpstore.ll
  llvm/test/CodeGen/RISCV/rvv/vadd-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vfabs-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vfma-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vfmuladd-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vfneg-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vfpext-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vfptosi-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vfptoui-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vfptrunc-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vfsqrt-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vmax-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vmaxu-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vmin-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vminu-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vpgather-sdnode.ll
  llvm/test/CodeGen/RISCV/rvv/vpload.ll
  llvm/test/CodeGen/RISCV/rvv/vpmerge-sdnode.ll
  llvm/test/CodeGen/RISCV/rvv/vpscatter-sdnode.ll
  llvm/test/CodeGen/RISCV/rvv/vpstore.ll
  llvm/test/CodeGen/RISCV/rvv/vreductions-fp-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vreductions-int-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vreductions-mask-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vselect-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vsext-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vsitofp-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vtrunc-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vuitofp-vp.ll
  llvm/test/CodeGen/RISCV/rvv/vzext-vp.ll
  llvm/test/CodeGen/RISCV/usub_sat.ll
  llvm/test/CodeGen/RISCV/usub_sat_plus.ll



More information about the llvm-commits mailing list