[all-commits] [llvm/llvm-project] 29bebb: [GISel] Add new combines for G_FMINNUM/MAXNUM and ...

Michael Kitzan via All-commits all-commits at lists.llvm.org
Wed May 18 12:22:28 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 29bebb0237965618b6c91fe32f63d13cf9ecabc5
      https://github.com/llvm/llvm-project/commit/29bebb0237965618b6c91fe32f63d13cf9ecabc5
  Author: Michael Kitzan <mkitzan at apple.com>
  Date:   2022-05-18 (Wed, 18 May 2022)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
    M llvm/include/llvm/Target/GlobalISel/Combine.td
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
    A llvm/test/CodeGen/AArch64/GlobalISel/combine-fminimum-fmaximum.mir
    A llvm/test/CodeGen/AArch64/GlobalISel/combine-fminnum-fmaxnum.mir

  Log Message:
  -----------
  [GISel] Add new combines for G_FMINNUM/MAXNUM and G_FMINIMUM/MAXIMUM

I noticed https://reviews.llvm.org/D87415 added SDAG combines to fold
FMIN/MAX instrs with NaNs.

The patch implements the same NaN combines for GISel GMIR FMIN/MAX opcodes:
G_FMINNUM(X, NaN) -> X
G_FMAXNUM(X, NaN) -> X
G_FMINIMUM(X, NaN) -> NaN
G_FMAXIMUM(X, NaN) -> NaN

The patch adds AArch64 tests for these combines as well.

Reviewed by: arsenm

Differential revision: https://reviews.llvm.org/D125819




More information about the All-commits mailing list