[PATCH] D94450: [LegalizeDAG][RISCV][PowerPC][AMDGPU][WebAssembly] Improve expansion of SETONE/SETUEQ on targets without SETO/SETUO.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 13:55:11 PST 2021


craig.topper created this revision.
craig.topper added reviewers: frasercrmck, efriedma, arsenm, evandro, asb, lenary, tlively.
Herald added subscribers: NickHung, ecnelises, kerbowa, luismarques, apazos, sameer.abuasal, pzheng, s.egerton, shchenz, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, sunfish, simoncook, johnrusso, rbar, hiraditya, jgravelle-google, t-tye, sbc100, tpr, dstuttard, yaxunl, nhaehnle, jvesely, nemanjai, kzhuravl, dschuff.
craig.topper requested review of this revision.
Herald added subscribers: MaskRay, aheejin, wdng.
Herald added a project: LLVM.

If SETO/SETUO aren't legal, they'll be expanded and we'll end up
with 3 comparisons.

SETONE is equivalent to (SETOGT || SETOLT)
so if one of those operations is supported use that expansion. We
don't need both since we can commute the operands to make the other.

SETUEQ can be implemented with !(SETOGT || SETOLT) or (SETULE && SETUGE).
I've only implemented the first because it didn't look like most of the
affected targets had legal SETULE/SETUGE.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94450

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  llvm/test/CodeGen/AMDGPU/setcc.ll
  llvm/test/CodeGen/PowerPC/spe.ll
  llvm/test/CodeGen/PowerPC/vsx.ll
  llvm/test/CodeGen/RISCV/double-br-fcmp.ll
  llvm/test/CodeGen/RISCV/double-fcmp.ll
  llvm/test/CodeGen/RISCV/double-select-fcmp.ll
  llvm/test/CodeGen/RISCV/float-br-fcmp.ll
  llvm/test/CodeGen/RISCV/float-fcmp.ll
  llvm/test/CodeGen/RISCV/float-select-fcmp.ll
  llvm/test/CodeGen/RISCV/half-br-fcmp.ll
  llvm/test/CodeGen/RISCV/half-fcmp.ll
  llvm/test/CodeGen/RISCV/half-select-fcmp.ll
  llvm/test/CodeGen/RISCV/rvv/setcc-fp-rv32.ll
  llvm/test/CodeGen/RISCV/rvv/setcc-fp-rv64.ll
  llvm/test/CodeGen/WebAssembly/comparisons-f32.ll
  llvm/test/CodeGen/WebAssembly/comparisons-f64.ll
  llvm/test/CodeGen/WebAssembly/simd-comparisons.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94450.315930.patch
Type: text/x-patch
Size: 71054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210111/1d0df0d2/attachment.bin>


More information about the llvm-commits mailing list