[PATCH] D151358: [LegalizeTypes] Improve expansion of wide SMIN/SMAX/UMIN/UMAX

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 11:37:15 PDT 2023


efriedma created this revision.
efriedma added reviewers: craig.topper, RKSimon, arsenm, reames, kaz7.
Herald added subscribers: luke, pmatos, asb, armkevincheng, sjarus, eric-k256, frasercrmck, kerbowa, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, dmgreen, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, jgravelle-google, sbc100, tpr, jvesely, dschuff.
Herald added a project: All.
efriedma requested review of this revision.
Herald added subscribers: pcwang-thead, MaskRay, aheejin, wdng.
Herald added a project: LLVM.

The current implementation tries to handle the high and low halves separately, but that's less efficient in most cases; use a wide SETCC instead.

Still some small regressions scattered across the testcases... the most concerning are AMDGPU and VE, where apparently this actually makes things worse somehow in the general case.  Do we need a target hook, or is there some way to use a unified codepath?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151358

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  llvm/test/CodeGen/AArch64/dag-combine-setcc.ll
  llvm/test/CodeGen/AArch64/fpclamptosat.ll
  llvm/test/CodeGen/AArch64/fpclamptosat_vec.ll
  llvm/test/CodeGen/AArch64/vecreduce-umax-legalization.ll
  llvm/test/CodeGen/AMDGPU/max.ll
  llvm/test/CodeGen/AMDGPU/min.ll
  llvm/test/CodeGen/AMDGPU/r600-legalize-umax-bug.ll
  llvm/test/CodeGen/ARM/fpclamptosat.ll
  llvm/test/CodeGen/ARM/fpclamptosat_vec.ll
  llvm/test/CodeGen/RISCV/fpclamptosat.ll
  llvm/test/CodeGen/RISCV/min-max.ll
  llvm/test/CodeGen/RISCV/rv32zbb.ll
  llvm/test/CodeGen/RISCV/rvv/fpclamptosat_vec.ll
  llvm/test/CodeGen/Thumb2/mve-fpclamptosat_vec.ll
  llvm/test/CodeGen/Thumb2/mve-minmaxi.ll
  llvm/test/CodeGen/Thumb2/mve-vmaxv-vminv-scalar.ll
  llvm/test/CodeGen/VE/Scalar/smax.ll
  llvm/test/CodeGen/VE/Scalar/smin.ll
  llvm/test/CodeGen/VE/Scalar/umax.ll
  llvm/test/CodeGen/VE/Scalar/umin.ll
  llvm/test/CodeGen/WebAssembly/fpclamptosat.ll
  llvm/test/CodeGen/WebAssembly/fpclamptosat_vec.ll
  llvm/test/CodeGen/X86/abds.ll
  llvm/test/CodeGen/X86/abdu.ll
  llvm/test/CodeGen/X86/fpclamptosat.ll
  llvm/test/CodeGen/X86/fpclamptosat_vec.ll
  llvm/test/CodeGen/X86/sdiv_fix_sat.ll
  llvm/test/CodeGen/X86/smax.ll
  llvm/test/CodeGen/X86/smin.ll
  llvm/test/CodeGen/X86/udiv_fix_sat.ll
  llvm/test/CodeGen/X86/umax.ll
  llvm/test/CodeGen/X86/umin.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151358.525276.patch
Type: text/x-patch
Size: 439712 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230524/d3ac3b0c/attachment-0001.bin>


More information about the llvm-commits mailing list