[llvm] [ValueTracking] Fix incorrect FMF propagation from select to fcmp (PR #195787)

Nathiyaa Sengodan via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 06:11:59 PDT 2026


================
@@ -8920,14 +8919,19 @@ static SelectPatternResult matchSelectPattern(CmpInst::Predicate Pred,
   SelectPatternNaNBehavior NaNBehavior = SPNB_NA;
   bool Ordered = false;
 
+  bool UseSelectFMFForNaN = (TrueVal == CmpLHS && FalseVal == CmpRHS) ||
+                            (TrueVal == CmpRHS && FalseVal == CmpLHS);
+
+  FastMathFlags NaNFMF = UseSelectFMFForNaN ? FMF : CmpFMF;
----------------
Nathiyaa-Sengodan wrote:

OK. I will update this. 

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


More information about the llvm-commits mailing list