[llvm] [ValueTracking] Treat fmul NaN sign bit as unknown to prevent incorrect fabs folding (PR #180339)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 9 02:33:17 PST 2026


================
@@ -356,6 +356,9 @@ KnownFPClass KnownFPClass::fmul(const KnownFPClass &KnownLHS,
        KnownRHS.isKnownNeverLogicalZero(Mode)))
     Known.knownNot(fcNan);
 
+  if (!Known.isKnownNeverNaN())
+    Known.SignBit = std::nullopt;
+
----------------
arsenm wrote:

This is trying to fix up a wrong result after the fact, the logic above shouldn't have set this to known ni the first place 

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


More information about the llvm-commits mailing list