[all-commits] [llvm/llvm-project] d4fa08: [mlir][arith] Improve Lowering of `maxf`/`minf` op...

Daniil Dudkin via All-commits all-commits at lists.llvm.org
Wed Sep 6 11:56:22 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4fa0884c308aa8eb73085420c976ce1df92d815
      https://github.com/llvm/llvm-project/commit/d4fa0884c308aa8eb73085420c976ce1df92d815
  Author: Daniil Dudkin <39276703+unterumarmung at users.noreply.github.com>
  Date:   2023-09-06 (Wed, 06 Sep 2023)

  Changed paths:
    M mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp
    M mlir/test/Conversion/ArithToLLVM/arith-to-llvm.mlir

  Log Message:
  -----------
  [mlir][arith] Improve Lowering of `maxf`/`minf` ops (#65213)

This patch is part of a larger initiative aimed at fixing floating-point
`max` and `min` operations in MLIR:
https://discourse.llvm.org/t/rfc-fix-floating-point-max-and-min-operations-in-mlir/72671.

This patch addresses task 1.1 from the plan. It involves modifying the
lowering process for `arith.minf` and `arith.maxf` operations.
Specifically, the change replaces the usage of `llvm.minnum` and
`llvm.maxnum` with `llvm.minimum` and `llvm.maximum`, respectively. This
adjustment is necessary because the `m**num` intrinsics are not suitable
for the mentioned MLIR operations due to semantic discrepancies in
handling NaNs, positive and negative floating-point zeros.




More information about the All-commits mailing list