[PATCH] D125819: [GISel] Add new combines for G_FMINNUM/MAXNUM and G_FMINIMUM/MAXIMUM

Michael Kitzan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 10:58:28 PDT 2022


mkitzan created this revision.
mkitzan added reviewers: aditya_nandakumar, paquette, dsanders, nlguillemot, arsenm.
mkitzan added a project: LLVM.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
mkitzan requested review of this revision.
Herald added subscribers: llvm-commits, wdng.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125819

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125819.430127.patch
Type: text/x-patch
Size: 14499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220517/93a7d732/attachment.bin>


More information about the llvm-commits mailing list