[llvm] 29ec071 - Fix comment typo in ExpandFCOPYSIGN (#111489)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 8 01:48:00 PDT 2024
Author: Ralf Jung
Date: 2024-10-08T12:47:56+04:00
New Revision: 29ec0716a872126db0dd2e981c51f9966af34824
URL: https://github.com/llvm/llvm-project/commit/29ec0716a872126db0dd2e981c51f9966af34824
DIFF: https://github.com/llvm/llvm-project/commit/29ec0716a872126db0dd2e981c51f9966af34824.diff
LOG: Fix comment typo in ExpandFCOPYSIGN (#111489)
I noticed this while following
https://github.com/llvm/llvm-project/pull/111269. It makes little sense
that FCOPYSIGN would look at the sign of `x`, right? Surely this must be
`y`. Also fix the inconsistency where it's sometimes `x` and sometimes
`X`.
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 42d031310d5e02..ea22b4670d6f1f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -1657,7 +1657,8 @@ SDValue SelectionDAGLegalize::ExpandFCOPYSIGN(SDNode *Node) const {
SDValue SignBit = DAG.getNode(ISD::AND, DL, IntVT, SignAsInt.IntValue,
SignMask);
- // If FABS is legal transform FCOPYSIGN(x, y) => sign(x) ? -FABS(x) : FABS(X)
+ // If FABS is legal transform
+ // FCOPYSIGN(x, y) => SignBit(y) ? -FABS(x) : FABS(x)
EVT FloatVT = Mag.getValueType();
if (TLI.isOperationLegalOrCustom(ISD::FABS, FloatVT) &&
TLI.isOperationLegalOrCustom(ISD::FNEG, FloatVT)) {
More information about the llvm-commits
mailing list