[llvm] [DAGCombiner] Remove NoSignedZerosFPMath in visitFNEG (PR #162052)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 6 02:34:07 PDT 2025
https://github.com/paperchalice created https://github.com/llvm/llvm-project/pull/162052
None
>From 67c7d1cda01b91a6ab76c50e38e3038e4af9d83c Mon Sep 17 00:00:00 2001
From: PaperChalice <liujunchang97 at outlook.com>
Date: Mon, 6 Oct 2025 17:20:53 +0800
Subject: [PATCH] [DAGCombiner] Remove NoSignedZerosFPMath in visitFNEG
---
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 204e1f0c75e00..d104d8a2967b6 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -19301,9 +19301,8 @@ SDValue DAGCombiner::visitFNEG(SDNode *N) {
// FIXME: This is duplicated in getNegatibleCost, but getNegatibleCost doesn't
// know it was called from a context with a nsz flag if the input fsub does
// not.
- if (N0.getOpcode() == ISD::FSUB &&
- (DAG.getTarget().Options.NoSignedZerosFPMath ||
- N->getFlags().hasNoSignedZeros()) && N0.hasOneUse()) {
+ if (N0.getOpcode() == ISD::FSUB && N->getFlags().hasNoSignedZeros() &&
+ N0.hasOneUse()) {
return DAG.getNode(ISD::FSUB, SDLoc(N), VT, N0.getOperand(1),
N0.getOperand(0));
}
More information about the llvm-commits
mailing list