[flang-commits] [clang] [flang] [libc] [libcxx] [lld] [lldb] [llvm] [mlir] [LV] Vectorize maxnum/minnum w/o fast-math flags. (PR #148239)

via flang-commits flang-commits at lists.llvm.org
Fri Jul 18 10:11:10 PDT 2025


================
@@ -103,6 +103,12 @@ struct VPlanTransforms {
   /// not valid.
   static bool adjustFixedOrderRecurrences(VPlan &Plan, VPBuilder &Builder);
 
+  /// Check if \p Plan contains any FMaxNumNoFMFs or FMinNumNoFMFs reductions.
+  /// If they do, try to update the vector loop to exit early if any input is
+  /// NaN and resume executing in the scalar loop to handle the NaNs there.
+  /// Return false if this attempt was unsuccessful.
+  static bool handleMaxMinNumReductionsWithoutFastMath(VPlan &Plan);
----------------
ayalz wrote:

Worth shortening, being the general case?

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


More information about the flang-commits mailing list