[llvm] [ValueTracking] Implement `computeKnownFPClass` for `llvm.vector.reduce.{fmin,fmax,fmaximum,fminimum}` (PR #88408)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 11 10:10:32 PDT 2024


================
@@ -5004,6 +5004,15 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
 
       break;
     }
+      // reduce min/max will choose an element from one of the vector elements,
+      // so we can infer and class information that is common to all elements.
+    case Intrinsic::vector_reduce_fmax:
+    case Intrinsic::vector_reduce_fmin:
+    case Intrinsic::vector_reduce_fmaximum:
+    case Intrinsic::vector_reduce_fminimum:
+      computeKnownFPClass(II->getArgOperand(0), Known, InterestedClasses,
----------------
dtcxzyw wrote:

You cannot keep the signbit information if we don't know it is never nan.


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


More information about the llvm-commits mailing list