[llvm] add narrowExtractedVectorUnaryOp to simplify cast nodes (PR #87977)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 02:54:56 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 d0dcf06ab8723cc4358ad446354cce875dd89577 02d887d71f45721218fda03dd6428e6caa24aee9 -- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 50bb270a66..10bc58ddcb 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -24086,11 +24086,11 @@ static SDValue narrowInsertExtractVectorBinOp(SDNode *Extract,
 /// If we are extracting a subvector produced by a wide unary operator try
 /// to use a narrow unary operator and/or avoid extraction.
 static SDValue narrowExtractedVectorUnaryOp(SDNode *Extract, SelectionDAG &DAG,
-                                          bool LegalOperations) {
+                                            bool LegalOperations) {
   const TargetLowering &TLI = DAG.getTargetLoweringInfo();
   SDValue UnaryOp = Extract->getOperand(0);
   unsigned UnaryOpcode = UnaryOp.getOpcode();
-  
+
   if (UnaryOpcode != ISD::FP_TO_SINT || UnaryOp->getNumValues() != 1)
     return SDValue();
 
@@ -24102,7 +24102,7 @@ static SDValue narrowExtractedVectorUnaryOp(SDNode *Extract, SelectionDAG &DAG,
   EVT WideUVT = UnaryOp.getValueType();
   if (!WideUVT.isFixedLengthVector())
     return SDValue();
-  
+
   EVT VT = Extract->getValueType(0);
   unsigned ExtractIndex = ExtractIndexC->getZExtValue();
   assert(ExtractIndex % VT.getVectorNumElements() == 0 &&
@@ -24123,7 +24123,7 @@ static SDValue narrowExtractedVectorUnaryOp(SDNode *Extract, SelectionDAG &DAG,
   if (!TLI.isOperationLegalOrCustomOrPromote(UnaryOpcode, NarrowUVT,
                                              LegalOperations))
     return SDValue();
-  
+
   SDLoc DL(Extract);
   auto ret = DAG.getNode(UnaryOpcode, DL, NarrowUVT, UnaryOp.getOperand(0));
   dbgs() << "reduced node found: \n";

``````````

</details>


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


More information about the llvm-commits mailing list