[PATCH] D78908: [RISCV] Add patterns for checking isnan

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 02:38:34 PDT 2020


lenary created this revision.
lenary added a reviewer: luismarques.
Herald added subscribers: llvm-commits, evandro, apazos, sameer.abuasal, pzheng, s.egerton, Jim, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, MaskRay, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
Herald added a project: LLVM.
lenary added a parent revision: D78907: [RISCV] Add tests for checking isnan patterns.

This patch addresses some weird assembly sequences we were seeing during
comparing floats. In particular, comparing a float to itself tells you whether
it is NaN or not, which we were doing correctly, but with an extra unneeded
`and` instruction.

This patch specialises the existing patterns to remove the `and` instruction
when both their operands are the same.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78908

Files:
  llvm/lib/Target/RISCV/RISCVInstrInfoD.td
  llvm/lib/Target/RISCV/RISCVInstrInfoF.td
  llvm/test/CodeGen/RISCV/double-isnan.ll
  llvm/test/CodeGen/RISCV/float-isnan.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78908.260253.patch
Type: text/x-patch
Size: 3780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200427/5bc6dca1/attachment-0001.bin>


More information about the llvm-commits mailing list