Skip to content

Commit c27baa5

Browse files
committed
[X86] isRepeatedTargetShuffleMask - don't require specific MVT type. NFC.
Split the isRepeatedTargetShuffleMask into a wrapper variant that takes a MVT describing the mask width, and an internal version that just needs the raw mask element bit size. This will be necessary for an upcoming change where the horizontal ops element width might not match the shuffle mask element width.
1 parent 402b063 commit c27baa5

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10720,10 +10720,11 @@ is256BitLaneRepeatedShuffleMask(MVT VT, ArrayRef<int> Mask,
1072010720

1072110721
/// Test whether a target shuffle mask is equivalent within each sub-lane.
1072210722
/// Unlike isRepeatedShuffleMask we must respect SM_SentinelZero.
10723-
static bool isRepeatedTargetShuffleMask(unsigned LaneSizeInBits, MVT VT,
10723+
static bool isRepeatedTargetShuffleMask(unsigned LaneSizeInBits,
10724+
unsigned EltSizeInBits,
1072410725
ArrayRef<int> Mask,
1072510726
SmallVectorImpl<int> &RepeatedMask) {
10726-
int LaneSize = LaneSizeInBits / VT.getScalarSizeInBits();
10727+
int LaneSize = LaneSizeInBits / EltSizeInBits;
1072710728
RepeatedMask.assign(LaneSize, SM_SentinelUndef);
1072810729
int Size = Mask.size();
1072910730
for (int i = 0; i < Size; ++i) {
@@ -10754,6 +10755,15 @@ static bool isRepeatedTargetShuffleMask(unsigned LaneSizeInBits, MVT VT,
1075410755
return true;
1075510756
}
1075610757

10758+
/// Test whether a target shuffle mask is equivalent within each sub-lane.
10759+
/// Unlike isRepeatedShuffleMask we must respect SM_SentinelZero.
10760+
static bool isRepeatedTargetShuffleMask(unsigned LaneSizeInBits, MVT VT,
10761+
ArrayRef<int> Mask,
10762+
SmallVectorImpl<int> &RepeatedMask) {
10763+
return isRepeatedTargetShuffleMask(LaneSizeInBits, VT.getScalarSizeInBits(),
10764+
Mask, RepeatedMask);
10765+
}
10766+
1075710767
/// Checks whether the vector elements referenced by two shuffle masks are
1075810768
/// equivalent.
1075910769
static bool IsElementEquivalent(int MaskSize, SDValue Op, SDValue ExpectedOp,

0 commit comments

Comments
 (0)