forked from OSchip/llvm-project
[X86][SSE] Pulled common variables to top of matchUnaryPermuteVectorShuffle. NFCI.
llvm-svn: 306847
This commit is contained in:
parent
e5e5e59d8b
commit
724990ab64
|
@ -27107,6 +27107,9 @@ static bool matchUnaryPermuteVectorShuffle(MVT MaskVT, ArrayRef<int> Mask,
|
||||||
unsigned &Shuffle, MVT &ShuffleVT,
|
unsigned &Shuffle, MVT &ShuffleVT,
|
||||||
unsigned &PermuteImm) {
|
unsigned &PermuteImm) {
|
||||||
unsigned NumMaskElts = Mask.size();
|
unsigned NumMaskElts = Mask.size();
|
||||||
|
unsigned InputSizeInBits = MaskVT.getSizeInBits();
|
||||||
|
unsigned MaskScalarSizeInBits = InputSizeInBits / NumMaskElts;
|
||||||
|
MVT MaskEltVT = MVT::getIntegerVT(MaskScalarSizeInBits);
|
||||||
|
|
||||||
bool ContainsZeros = false;
|
bool ContainsZeros = false;
|
||||||
APInt Zeroable(NumMaskElts, false);
|
APInt Zeroable(NumMaskElts, false);
|
||||||
|
@ -27122,7 +27125,7 @@ static bool matchUnaryPermuteVectorShuffle(MVT MaskVT, ArrayRef<int> Mask,
|
||||||
if (AllowIntDomain && ((MaskVT.is128BitVector() && Subtarget.hasSSE2()) ||
|
if (AllowIntDomain && ((MaskVT.is128BitVector() && Subtarget.hasSSE2()) ||
|
||||||
(MaskVT.is256BitVector() && Subtarget.hasAVX2()))) {
|
(MaskVT.is256BitVector() && Subtarget.hasAVX2()))) {
|
||||||
int ShiftAmt = matchVectorShuffleAsShift(ShuffleVT, Shuffle,
|
int ShiftAmt = matchVectorShuffleAsShift(ShuffleVT, Shuffle,
|
||||||
MaskVT.getScalarSizeInBits(), Mask,
|
MaskScalarSizeInBits, Mask,
|
||||||
0, Zeroable, Subtarget);
|
0, Zeroable, Subtarget);
|
||||||
if (0 < ShiftAmt) {
|
if (0 < ShiftAmt) {
|
||||||
PermuteImm = (unsigned)ShiftAmt;
|
PermuteImm = (unsigned)ShiftAmt;
|
||||||
|
@ -27138,10 +27141,6 @@ static bool matchUnaryPermuteVectorShuffle(MVT MaskVT, ArrayRef<int> Mask,
|
||||||
return SM_SentinelUndef <= M && M < (int)NumMaskElts;
|
return SM_SentinelUndef <= M && M < (int)NumMaskElts;
|
||||||
}) && "Expected unary shuffle");
|
}) && "Expected unary shuffle");
|
||||||
|
|
||||||
unsigned InputSizeInBits = MaskVT.getSizeInBits();
|
|
||||||
unsigned MaskScalarSizeInBits = InputSizeInBits / Mask.size();
|
|
||||||
MVT MaskEltVT = MVT::getIntegerVT(MaskScalarSizeInBits);
|
|
||||||
|
|
||||||
// Handle PSHUFLW/PSHUFHW repeated patterns.
|
// Handle PSHUFLW/PSHUFHW repeated patterns.
|
||||||
if (MaskScalarSizeInBits == 16) {
|
if (MaskScalarSizeInBits == 16) {
|
||||||
SmallVector<int, 4> RepeatedMask;
|
SmallVector<int, 4> RepeatedMask;
|
||||||
|
|
Loading…
Reference in New Issue