[llvm] [LLVM] Slay undead copysign code (PR #111269)

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 5 17:54:28 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 47e6d1816251e90b3d589710c5203a92c6015a7c 816d37e2caa2bb40db3a615410f26d4e42f10ae3 --extensions cpp -- llvm/lib/CodeGen/IntrinsicLowering.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/lib/IR/RuntimeLibcalls.cpp llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp
index 61d5f75273..29cfc1ffa3 100644
--- a/llvm/lib/CodeGen/IntrinsicLowering.cpp
+++ b/llvm/lib/CodeGen/IntrinsicLowering.cpp
@@ -443,13 +443,13 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
   }
   case Intrinsic::copysign: {
     switch (CI->getArgOperand(0)->getType()->getTypeID()) {
-      default:
-        assert("only need a copysign libcall for arch-specific floats");
-        break;
-      case Type::X86_FP80TyID:
-      case Type::PPC_FP128TyID:
-        ReplaceCallWith("copysignl", CI, CI->arg_begin(), CI->arg_end(),
-                        Type::getFloatTy(CI->getContext()));
+    default:
+      assert("only need a copysign libcall for arch-specific floats");
+      break;
+    case Type::X86_FP80TyID:
+    case Type::PPC_FP128TyID:
+      ReplaceCallWith("copysignl", CI, CI->arg_begin(), CI->arg_end(),
+                      Type::getFloatTy(CI->getContext()));
     }
     break;
   }
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index 0e4d364f69..4acda15d1b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -1651,9 +1651,11 @@ void DAGTypeLegalizer::ExpandFloatRes_FCOPYSIGN(SDNode *N,
                                                 SDValue &Lo, SDValue &Hi) {
 
   auto VT = N->getValueType(0);
-  ExpandFloatRes_Binary(N, (VT == MVT::f80 ? RTLIB::COPYSIGN_F80 :
-                            VT == MVT::ppcf128 ? RTLIB::COPYSIGN_PPCF128 :
-                            RTLIB::UNKNOWN_LIBCALL), Lo, Hi);
+  ExpandFloatRes_Binary(N,
+                        (VT == MVT::f80       ? RTLIB::COPYSIGN_F80
+                         : VT == MVT::ppcf128 ? RTLIB::COPYSIGN_PPCF128
+                                              : RTLIB::UNKNOWN_LIBCALL),
+                        Lo, Hi);
 }
 
 void DAGTypeLegalizer::ExpandFloatRes_FCOS(SDNode *N,

``````````

</details>


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


More information about the llvm-commits mailing list