[llvm] [LV] Vectorize FMax w/o fast-math flags. (PR #146711)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 12 03:04:37 PDT 2025


================
@@ -47,6 +47,9 @@ enum class RecurKind {
   FMul,     ///< Product of floats.
   FMin,     ///< FP min implemented in terms of select(cmp()).
   FMax,     ///< FP max implemented in terms of select(cmp()).
+  FCmpOGTSelect, ///< FP max implemented in terms of select(cmp()), but without
----------------
ayalz wrote:

The naming issue was admittedly raised before. This is still documented and titled as dealing with "FP max", and also affects loops doing `fcmp ugt` and `select` as in a testcase at the bottom. If RecurKind tries to capture the explicit pattern in the input IR, it may need to accommodate a variety of compare predicates. Signed and unsigned max and min try, OTOH, to abstract cmp/select pairs having a variety of lt/le/gt/ge predicated and same or reversed operands. Is this aiming to handle Ordered and/or Unordered FMax reduction of sets that may include NaNs (in terms of select(cmp()))?

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


More information about the llvm-commits mailing list