[llvm] [ValueTracking] Fix computeKnownFPClass handling of nsz (PR #186315)

Yunbo Ni via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 11 04:31:45 PDT 2026


================
@@ -6122,6 +6122,20 @@ void computeKnownFPClass(const Value *V, const APInt &DemandedElts,
   default:
     break;
   }
+
+  // With no-signed-zeros semantics, +0 and -0 are interchangeable.
+  // If the operation has nsz and only one sign of zero is possible in the
+  // result, the other must also be considered possible.
+  if (const auto *FPOp = dyn_cast_or_null<FPMathOperator>(Op)) {
----------------
cardigan1008 wrote:

It will be late as the existing flag check is before fadd_self inference. 

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


More information about the llvm-commits mailing list