[clang] [flang] [mlir] [flang,acc] Support -ffp-maxmin-behavior option in lowering. (PR #184730)

Tarun Prabhu via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 07:20:38 PST 2026


================
@@ -0,0 +1,40 @@
+//===- Support/FPMaxminBehavior.h - FP max/min behavior option --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Shared definition of FP max/min behavior for MAX/MIN and [max|min][loc|val].
+/// Used by CodeGenOptions, LoweringOptions, and other components.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef FORTRAN_SUPPORT_FPMAXMINBEHAVIOR_H_
+#define FORTRAN_SUPPORT_FPMAXMINBEHAVIOR_H_
+
+#include "llvm/ADT/StringRef.h"
+
+namespace Fortran::common {
+
+/// Control for MAX/MIN and [max|min][loc|val] lowering, constant folding, and
+/// related behavior. Legacy: current Flang behavior (always cmp+select).
+/// Portable: same as Legacy but may use arith.maxnumf under
+/// '-fno-signed-zeros -fno-honor-nans'. Extremum/Extremenum: maximumf/minnumf.
----------------
tarunprabhu wrote:

It may be good to expand on `Extremum` and `Extremenum` here. I see that you have used `maximumf` and `minnumf`, but again the spelling is so close that it may make sense to be a bit more verbose.

https://github.com/llvm/llvm-project/pull/184730


More information about the cfe-commits mailing list