[llvm] [DAG] Fixing the non-optimal code with the following: `select i1 %0, float 1.0, float 0.0`. (PR #107732)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 8 01:00:12 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 718fbcb27194aefa8db45aed4b93bd0727196b3a c8fdf94085c2a6aae2c243c3c2ec543527218a70 --extensions cpp -- llvm/lib/Target/X86/X86ISelLowering.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 3e69336714..9469acd171 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -24151,8 +24151,8 @@ SDValue X86TargetLowering::LowerSELECT(SDValue Op, SelectionDAG &DAG) const {
   }
 
   // (select cc, 1.0, 0.0) -> (sint_to_fp (zext cc))
-  const ConstantFPSDNode* FPTV = dyn_cast<ConstantFPSDNode>(Op1);
-  const ConstantFPSDNode* FPFV = dyn_cast<ConstantFPSDNode>(Op2);
+  const ConstantFPSDNode *FPTV = dyn_cast<ConstantFPSDNode>(Op1);
+  const ConstantFPSDNode *FPFV = dyn_cast<ConstantFPSDNode>(Op2);
   if (FPTV && FPFV && FPTV->isExactlyValue(1.0) && FPFV->isExactlyValue(0.0)) {
     return DAG.getNode(ISD::SINT_TO_FP, DL, Op.getValueType(), Cond);
   }

``````````

</details>


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


More information about the llvm-commits mailing list