[all-commits] [llvm/llvm-project] 89b98c: [flang] Fixed simplification for FP maxval.

Slava Zakharin via All-commits all-commits at lists.llvm.org
Mon Aug 21 19:34:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 89b98c13e02340d0aad37cc3bc6c5c579ca92918
      https://github.com/llvm/llvm-project/commit/89b98c13e02340d0aad37cc3bc6c5c579ca92918
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2023-08-21 (Mon, 21 Aug 2023)

  Changed paths:
    M flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
    M flang/test/Transforms/simplifyintrinsics.fir

  Log Message:
  -----------
  [flang] Fixed simplification for FP maxval.

On x86, a simplified F128 maxval ends up calling fmaxl that does not
work properly for F128 arguments. It is probably an LLVM issue, but
we also should not use arith.maxf if NaN or -0.0 operands are possible.
The change is to use cmpf and select. Unfortunately, these arith ops
do not support FastMathFlags currently, so I will have to fix this
sooner or later (depending on how this affects performance).

Reviewed By: kiranchandramohan

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




More information about the All-commits mailing list