[llvm] [X86] combineVTRUNCSAT - don't split 128-bit concatenated vectors when folding to PACKSS/US (PR #194347)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 07:30:07 PDT 2026


================
@@ -55643,7 +55644,17 @@ static SDValue combineVTRUNCSAT(SDNode *N, SelectionDAG &DAG,
       (EltSizeInBits * 2) == Src.getScalarValueSizeInBits() &&
       isFreeToSplitVector(Src, DAG)) {
     SDLoc DL(N);
-    auto [LHS, RHS] = splitVector(Src, DAG, DL);
+    SDValue LHS, RHS;
+    if (Src.getValueSizeInBits() == VT.getSizeInBits()) {
+      assert(VT.is128BitVector() && "128-bit VTRUNC source expected");
+      LHS = Src;
+      RHS = getZeroVector(Src.getSimpleValueType(), Subtarget, DAG, DL);
----------------
phoebewang wrote:

Can this be an undef vector?

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


More information about the llvm-commits mailing list