[llvm] [X86] combineX86ShuffleChain - always prefer VPERMQ/PD for unary subvector shuffles on AVX2+ targets (PR #134849)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 8 06:47:14 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)) &&
----------------
RKSimon wrote:
Sorry, I don't understand - combining to the AVX2+ only VPERMQ/VPERMPD happens later inside matchUnaryPermuteShuffle - AVX1 targets will still use the existing VPERM2X128 path here.
https://github.com/llvm/llvm-project/pull/134849
More information about the llvm-commits
mailing list