Skip to content

Commit 2c0b888

Browse files
authored
[X86] combineX86ShuffleChain - prefer combining to X86ISD::SHUF128 if PERMQ operands are splittable (#133900)
If the 512-bit unary shuffle is a concatenation of 128/256-bit subvectors then we're better off using a X86ISD::SHUF128 node so we can fold the concatenation into the shuffle as well.
1 parent a338f80 commit 2c0b888

File tree

2 files changed

+1620
-1687
lines changed

2 files changed

+1620
-1687
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39797,7 +39797,8 @@ static SDValue combineX86ShuffleChain(
3979739797
// FIXME: Is there a better way to do this? is256BitLaneRepeatedShuffleMask
3979839798
// doesn't work because our mask is for 128 bits and we don't have an MVT
3979939799
// to match that.
39800-
bool PreferPERMQ = UnaryShuffle && isUndefOrInRange(ScaledMask[0], 0, 2) &&
39800+
bool PreferPERMQ = UnaryShuffle && !isFreeToSplitVector(V1, DAG) &&
39801+
isUndefOrInRange(ScaledMask[0], 0, 2) &&
3980139802
isUndefOrInRange(ScaledMask[1], 0, 2) &&
3980239803
isUndefOrInRange(ScaledMask[2], 2, 4) &&
3980339804
isUndefOrInRange(ScaledMask[3], 2, 4) &&

0 commit comments

Comments
 (0)