[all-commits] [llvm/llvm-project] 96e09f: [X86] Avoid usage constant NaN for fminimum/fmaxim...

serguei-katkov via All-commits all-commits at lists.llvm.org
Fri May 5 01:43:14 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 96e09fef3cd8cf1f8f18d6cc70ba7bb6d8dcc4c3
  Author: Serguei Katkov <serguei.katkov at azul.com>
  Date:   2023-05-05 (Fri, 05 May 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/avx512fp16-fminimum-fmaximum.ll
    M llvm/test/CodeGen/X86/extract-fp.ll
    M llvm/test/CodeGen/X86/extractelement-fp.ll
    M llvm/test/CodeGen/X86/fminimum-fmaximum.ll

  Log Message:
  [X86] Avoid usage constant NaN for fminimum/fmaximum lowering

After applying FMIN/FMAX, if any of operands is NaN, the second operand will be the result.
So all we need is to check whether first operand is NaN and return it or result of FMIN/FMAX.

So we avoid usage of constant NaN in the lowering.

Additionally we can avoid handling NaN after FMIN/FMAX if we are sure that first operand is not NaN.

Reviewed By: e-kud
Differential Revision: https://reviews.llvm.org/D149729

More information about the All-commits mailing list