[llvm] [SystemZ] Don't scalarize truncating vector fp to uint conversions. (PR #205311)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 03:20:33 PDT 2026


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 origin/main HEAD --extensions h,cpp -- llvm/lib/Target/SystemZ/SystemZISelLowering.cpp llvm/lib/Target/SystemZ/SystemZISelLowering.h llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
index 1f805812b..eb364f78a 100644
--- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -8587,8 +8587,8 @@ SDValue SystemZTargetLowering::combineINT_TO_FP(
   return SDValue();
 }
 
-SDValue SystemZTargetLowering::combineFP_TO_UINT(
-    SDNode *N, DAGCombinerInfo &DCI) const {
+SDValue SystemZTargetLowering::combineFP_TO_UINT(SDNode *N,
+                                                 DAGCombinerInfo &DCI) const {
   if (DCI.Level != BeforeLegalizeTypes)
     return SDValue();
   SelectionDAG &DAG = DCI.DAG;
@@ -8606,8 +8606,8 @@ SDValue SystemZTargetLowering::combineFP_TO_UINT(
       isPowerOf2_32(OutScalarBits)) {
     // Vector conversion to same bitwidth.
     unsigned NumElts = cast<FixedVectorType>(OutLLVMTy)->getNumElements();
-    EVT ConvVT = EVT::getVectorVT(Ctx, EVT::getIntegerVT(Ctx, InScalarBits),
-                                  NumElts);
+    EVT ConvVT =
+        EVT::getVectorVT(Ctx, EVT::getIntegerVT(Ctx, InScalarBits), NumElts);
     SDValue ConvOp = DAG.getNode(ISD::FP_TO_UINT, DL, ConvVT, Op);
 
     // Bitcast to narrow elements vector type.
@@ -8620,9 +8620,9 @@ SDValue SystemZTargetLowering::combineFP_TO_UINT(
     unsigned EltFac = InScalarBits / OutScalarBits;
     SmallVector<SDValue, SystemZ::VectorBytes> Ops;
     unsigned I = 0;
-    for (; I < NumElts ; ++I)
-      Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, TruncEltVT,
-                        BCast, DAG.getConstant(I * EltFac, DL, MVT::i32)));
+    for (; I < NumElts; ++I)
+      Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, TruncEltVT, BCast,
+                                DAG.getConstant(I * EltFac, DL, MVT::i32)));
     for (; I < NumTruncElts; ++I)
       Ops.push_back(DAG.getUNDEF(TruncEltVT));
     SDValue BV = DAG.getBuildVector(TruncVecVT, DL, Ops);
@@ -9470,7 +9470,8 @@ SDValue SystemZTargetLowering::PerformDAGCombine(SDNode *N,
   case ISD::FP_EXTEND:          return combineFP_EXTEND(N, DCI);
   case ISD::SINT_TO_FP:
   case ISD::UINT_TO_FP:         return combineINT_TO_FP(N, DCI);
-  case ISD::FP_TO_UINT:         return combineFP_TO_UINT(N, DCI);
+  case ISD::FP_TO_UINT:
+    return combineFP_TO_UINT(N, DCI);
   case ISD::FCOPYSIGN:          return combineFCOPYSIGN(N, DCI);
   case ISD::BSWAP:              return combineBSWAP(N, DCI);
   case ISD::SETCC:              return combineSETCC(N, DCI);

``````````

</details>


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


More information about the llvm-commits mailing list