diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 25f157d635db..e72d0895deb7 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -10720,10 +10720,11 @@ is256BitLaneRepeatedShuffleMask(MVT VT, ArrayRef Mask, /// Test whether a target shuffle mask is equivalent within each sub-lane. /// Unlike isRepeatedShuffleMask we must respect SM_SentinelZero. -static bool isRepeatedTargetShuffleMask(unsigned LaneSizeInBits, MVT VT, +static bool isRepeatedTargetShuffleMask(unsigned LaneSizeInBits, + unsigned EltSizeInBits, ArrayRef Mask, SmallVectorImpl &RepeatedMask) { - int LaneSize = LaneSizeInBits / VT.getScalarSizeInBits(); + int LaneSize = LaneSizeInBits / EltSizeInBits; RepeatedMask.assign(LaneSize, SM_SentinelUndef); int Size = Mask.size(); for (int i = 0; i < Size; ++i) { @@ -10754,6 +10755,15 @@ static bool isRepeatedTargetShuffleMask(unsigned LaneSizeInBits, MVT VT, return true; } +/// Test whether a target shuffle mask is equivalent within each sub-lane. +/// Unlike isRepeatedShuffleMask we must respect SM_SentinelZero. +static bool isRepeatedTargetShuffleMask(unsigned LaneSizeInBits, MVT VT, + ArrayRef Mask, + SmallVectorImpl &RepeatedMask) { + return isRepeatedTargetShuffleMask(LaneSizeInBits, VT.getScalarSizeInBits(), + Mask, RepeatedMask); +} + /// Checks whether the vector elements referenced by two shuffle masks are /// equivalent. static bool IsElementEquivalent(int MaskSize, SDValue Op, SDValue ExpectedOp,