[all-commits] [llvm/llvm-project] a4a9a1: [RISCV] Add patterns for checking isnan

Sam Elliott via All-commits all-commits at lists.llvm.org
Sat May 2 07:01:58 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a4a9a1f671ed79b648b41fca1a9c01b14cc1cbfc
      https://github.com/llvm/llvm-project/commit/a4a9a1f671ed79b648b41fca1a9c01b14cc1cbfc
  Author: Sam Elliott <selliott at lowrisc.org>
  Date:   2020-05-02 (Sat, 02 May 2020)

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

  Log Message:
  -----------
  [RISCV] Add patterns for checking isnan

Summary:
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` instructions
when both their operands are the same.

Reviewed By: luismarques, asb

Differential Revision: https://reviews.llvm.org/D78908




More information about the All-commits mailing list