This is an archive of the discontinued LLVM Phabricator instance.

[mlir][arith] Improve Lowering of `maxf`/`minf` ops
AbandonedPublic

Authored by unterumarmung on Aug 25 2023, 10:44 AM.

Details

Reviewers
ftynse
dcaballe
Summary

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.

Diff Detail

Event Timeline

unterumarmung created this revision.Aug 25 2023, 10:44 AM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
unterumarmung requested review of this revision.Aug 25 2023, 10:44 AM
unterumarmung abandoned this revision.Sep 2 2023, 2:28 PM