[llvm] [AMDGPU] Fix isKnownNeverNaN for FMIN_LEGACY/FMAX_LEGACY (PR #216338)
Arseniy Obolenskiy via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 16 23:04:01 PDT 2026
================
@@ -9248,6 +9248,413 @@ define double @v_test_nnan_input_fmed3_r_i_i_f64_maximum_minimum(double %a) {
ret double %med
}
+; FMIN_LEGACY/FMAX_LEGACY are compare-selects that return one of the operands
+; bit-for-bit, so a signaling NaN operand passes through unquieted. Their
+; result must not be treated as known-never-sNaN.
+
+; The canonicalize of the min_legacy result must be kept to quiet a
+; passed-through sNaN.
----------------
aobolensk wrote:
Trimmed comments, as for the tests location: forming v_med3_f32 from a min(max(x, c1), c2) chain relies on isKnownNeverNaN to decide it's safe to fold directly
https://github.com/llvm/llvm-project/pull/216338
More information about the llvm-commits
mailing list