forked from OSchip/llvm-project
[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.
This commit is contained in:
parent
402b063c80
commit
c27baa54b7
|
@ -10720,10 +10720,11 @@ is256BitLaneRepeatedShuffleMask(MVT VT, ArrayRef<int> 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<int> Mask,
|
||||
SmallVectorImpl<int> &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<int> Mask,
|
||||
SmallVectorImpl<int> &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,
|
||||
|
|
Loading…
Reference in New Issue