return CanonicalizeShuffleInput(RootVT, V1);
}
- // Attempt to match a subvector broadcast.
- // shuffle(insert_subvector(undef, sub, 0), undef, 0, 0, 0, 0)
- if (UnaryShuffle &&
- (BaseMaskEltSizeInBits == 128 || BaseMaskEltSizeInBits == 256)) {
- if (isUndefOrEqual(BaseMask, 0)) {
- SDValue Src = Inputs[0];
- if (Src.getOpcode() == ISD::INSERT_SUBVECTOR &&
- Src.getOperand(0).isUndef() &&
- Src.getOperand(1).getValueSizeInBits() == BaseMaskEltSizeInBits &&
- MayFoldLoad(Src.getOperand(1)) && isNullConstant(Src.getOperand(2))) {
- return DAG.getBitcast(RootVT, DAG.getNode(X86ISD::SUBV_BROADCAST, DL,
- Src.getValueType(),
- Src.getOperand(1)));
- }
- }
- }
-
// Handle 128/256-bit lane shuffles of 512-bit vectors.
if (RootVT.is512BitVector() &&
(NumBaseMaskElts == 2 || NumBaseMaskElts == 4)) {
// Repeated subvectors.
if (IsSplat) {
- // If this broadcast/subv_broadcast is inserted into both halves, use a
- // larger broadcast/subv_broadcast.
- if (Op0.getOpcode() == X86ISD::VBROADCAST ||
- Op0.getOpcode() == X86ISD::SUBV_BROADCAST)
+ // If this broadcast is inserted into both halves, use a larger broadcast.
+ if (Op0.getOpcode() == X86ISD::VBROADCAST)
return DAG.getNode(Op0.getOpcode(), DL, VT, Op0.getOperand(0));
// If this broadcast_load is inserted into both halves, use a larger