[PATCH] D59699: [RISCV] Optimize selection of fcmp one and fcmp ord

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 08:51:27 PDT 2019


luismarques created this revision.
luismarques added reviewers: asb, apazos, rogfer01.
Herald added subscribers: llvm-commits, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar.
Herald added a project: LLVM.

The lowerings of `fcmp one` and `fcmp ord` do a negation (xor 1) of a setuo 
result. The RISC-V expansion of setuo also includes a negation. Therefore, we 
were emitting an unnecessary double negation. This patch adds a pattern (xor 
(setuo ...), 1) that avoids emitting the double negation.


Repository:
  rL LLVM

https://reviews.llvm.org/D59699

Files:
  lib/Target/RISCV/RISCVInstrInfoD.td
  lib/Target/RISCV/RISCVInstrInfoF.td
  test/CodeGen/RISCV/double-br-fcmp.ll
  test/CodeGen/RISCV/double-fcmp.ll
  test/CodeGen/RISCV/double-select-fcmp.ll
  test/CodeGen/RISCV/float-br-fcmp.ll
  test/CodeGen/RISCV/float-fcmp.ll
  test/CodeGen/RISCV/float-select-fcmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59699.191887.patch
Type: text/x-patch
Size: 9075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190322/e1b38cc8/attachment.bin>


More information about the llvm-commits mailing list