[llvm] [X86] combineX86ShuffleChain - always prefer VPERMQ/PD for unary subvector shuffles on AVX2+ targets (PR #134849)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 8 06:26:23 PDT 2025


================
@@ -39838,15 +39838,14 @@ static SDValue combineX86ShuffleChain(
       return insertSubVector(Lo, Hi, NumRootElts / 2, DAG, DL, 128);
     }
 
-    if (Depth == 0 && RootOpc == X86ISD::VPERM2X128)
-      return SDValue(); // Nothing to do!
-
     // If we have AVX2, prefer to use VPERMQ/VPERMPD for unary shuffles unless
     // we need to use the zeroing feature.
     // Prefer blends for sequential shuffles unless we are optimizing for size.
     if (UnaryShuffle &&
         !(Subtarget.hasAVX2() && isUndefOrInRange(Mask, 0, 2)) &&
----------------
phoebewang wrote:

Sorry, I meant the description in this patch. I think the added code under this condition doesn't work. The AVX1 test for test_mul2x2_f64 also shows it.

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


More information about the llvm-commits mailing list