[llvm] [RISCV] Form vredsum from explode_vector + scalar (left) reduce (PR #67821)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 09:04:03 PDT 2023


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 c718336c4cb14e27aa88054cc30ee0c2fc6505d1 f224bd2efb5f3c05049da5d9405389f47c344fcf -- llvm/lib/Target/RISCV/RISCVISelLowering.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index d51d72edb64c..04c0e112fb71 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -11128,8 +11128,9 @@ void RISCVTargetLowering::ReplaceNodeResults(SDNode *N,
 /// forrests with multiple roots sharing common nodes.  In some cases, one
 /// of the trees will be vectorized, and the other will remain (unprofitably)
 /// scalarized.
-static SDValue combineBinOpOfExtractToReduceTree(SDNode *N, SelectionDAG &DAG,
-                                                 const RISCVSubtarget &Subtarget) {
+static SDValue
+combineBinOpOfExtractToReduceTree(SDNode *N, SelectionDAG &DAG,
+                                  const RISCVSubtarget &Subtarget) {
 
   // This transforms need to run before all integer types have been legalized
   // to i64 (so that the vector element type matches the add type), and while
@@ -11190,7 +11191,7 @@ static SDValue combineBinOpOfExtractToReduceTree(SDNode *N, SelectionDAG &DAG,
       // wider (hopefully legal) type.  If this is a terminal state, we are
       // relying on type legalization here to poduce something reasonable
       // and this lowering quality could probably be improved. (TODO)
-      EVT ReduceVT = EVT::getVectorVT(*DAG.getContext(), VT, Idx+1);
+      EVT ReduceVT = EVT::getVectorVT(*DAG.getContext(), VT, Idx + 1);
       SDValue Vec = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, ReduceVT, SrcVec,
                                 DAG.getVectorIdxConstant(0, DL));
       return DAG.getNode(ISD::VECREDUCE_ADD, DL, VT, Vec);
@@ -11200,7 +11201,6 @@ static SDValue combineBinOpOfExtractToReduceTree(SDNode *N, SelectionDAG &DAG,
   return SDValue();
 }
 
-
 // Try to fold (<bop> x, (reduction.<bop> vec, start))
 static SDValue combineBinOpToReduce(SDNode *N, SelectionDAG &DAG,
                                     const RISCVSubtarget &Subtarget) {

``````````

</details>


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


More information about the llvm-commits mailing list