[llvm] [DAG][RISCV] Use vp_reduce_* when widening illegal types for reductions (PR #105455)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 17:29:10 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 3145cff24bda61ae0d3ba3981c19599f12af95ab 8d6c803a27681436d9f08dcea078cf971572f96d --extensions cpp -- llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 763b363959..2cc9a8c948 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -7316,17 +7316,14 @@ SDValue DAGTypeLegalizer::WidenVecOp_VECREDUCE(SDNode *N) {
                                           WideVT.getVectorElementCount());
         TLI.isTypeLegal(WideMaskVT)) {
       SDValue Start =
-        DAG.getNode(getExtendForIntVecReduction(N), dl, VT, NeutralElem);
+          DAG.getNode(getExtendForIntVecReduction(N), dl, VT, NeutralElem);
       SDValue Mask = DAG.getAllOnesConstant(dl, WideMaskVT);
-      SDValue EVL =
-          DAG.getElementCount(dl, TLI.getVPExplicitVectorLengthTy(),
-                              OrigVT.getVectorElementCount());
-      return DAG.getNode(*VPOpcode, dl, VT,
-                         {Start, Op, Mask, EVL}, Flags);
+      SDValue EVL = DAG.getElementCount(dl, TLI.getVPExplicitVectorLengthTy(),
+                                        OrigVT.getVectorElementCount());
+      return DAG.getNode(*VPOpcode, dl, VT, {Start, Op, Mask, EVL}, Flags);
     }
   }
 
-
   if (WideVT.isScalableVector()) {
     unsigned GCD = std::gcd(OrigElts, WideElts);
     EVT SplatVT = EVT::getVectorVT(*DAG.getContext(), ElemVT,

``````````

</details>


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


More information about the llvm-commits mailing list