================
@@ -2196,9 +2196,25 @@ Value 
*InstCombinerImpl::SimplifyDemandedUseFPClass(Value *V,
       auto *FPOp = cast<FPMathOperator>(CI);
 
       bool ChangedFlags = false;
+      if (!FPOp->hasNoSignedZeros()) {
+        // Add NSZ flag if we know the result will not be sensitive on the sign
+        // of 0.
+        FPClassTest ZeroMask = fcZero;
+
+        if (Mode != DenormalMode::getIEEE())
+          ZeroMask |= fcSubnormal;
+
+        bool ResultNotLogical0 = (ValidResults & ZeroMask) == fcNone;
+        if (ResultNotLogical0 ||
+            ((KnownLHS.isKnownNeverLogicalNegZero(Mode) ||
----------------
dtcxzyw wrote:

That's fine with me.

https://github.com/llvm/llvm-project/pull/173898
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to