Lines Matching refs:Mask
360 FPClassTest Mask = Attrs.getRetNoFPClass(); in getRetNoFPClass() local
363 Mask |= F->getAttributes().getRetNoFPClass(); in getRetNoFPClass()
364 return Mask; in getRetNoFPClass()
368 FPClassTest Mask = Attrs.getParamNoFPClass(i); in getParamNoFPClass() local
371 Mask |= F->getAttributes().getParamNoFPClass(i); in getParamNoFPClass()
372 return Mask; in getParamNoFPClass()
1661 ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *Mask, const Twine &Name, in ShuffleVectorInst() argument
1663 : ShuffleVectorInst(V1, createPlaceholderForShuffleVector(V1), Mask, Name, in ShuffleVectorInst()
1666 ShuffleVectorInst::ShuffleVectorInst(Value *V1, ArrayRef<int> Mask, in ShuffleVectorInst() argument
1669 : ShuffleVectorInst(V1, createPlaceholderForShuffleVector(V1), Mask, Name, in ShuffleVectorInst()
1672 ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, Value *Mask, in ShuffleVectorInst() argument
1677 cast<VectorType>(Mask->getType())->getElementCount()), in ShuffleVectorInst()
1680 assert(isValidOperands(V1, V2, Mask) && in ShuffleVectorInst()
1686 getShuffleMask(cast<Constant>(Mask), MaskArr); in ShuffleVectorInst()
1691 ShuffleVectorInst::ShuffleVectorInst(Value *V1, Value *V2, ArrayRef<int> Mask, in ShuffleVectorInst() argument
1696 Mask.size(), isa<ScalableVectorType>(V1->getType())), in ShuffleVectorInst()
1699 assert(isValidOperands(V1, V2, Mask) && in ShuffleVectorInst()
1703 setShuffleMask(Mask); in ShuffleVectorInst()
1726 ArrayRef<int> Mask) { in isValidOperands() argument
1734 for (int Elem : Mask) in isValidOperands()
1739 if ((Mask[0] != 0 && Mask[0] != PoisonMaskElem) || !all_equal(Mask)) in isValidOperands()
1746 const Value *Mask) { in isValidOperands() argument
1753 auto *MaskTy = dyn_cast<VectorType>(Mask->getType()); in isValidOperands()
1759 if (isa<UndefValue>(Mask) || isa<ConstantAggregateZero>(Mask)) in isValidOperands()
1762 if (const auto *MV = dyn_cast<ConstantVector>(Mask)) { in isValidOperands()
1775 if (const auto *CDS = dyn_cast<ConstantDataSequential>(Mask)) { in isValidOperands()
1787 void ShuffleVectorInst::getShuffleMask(const Constant *Mask, in getShuffleMask() argument
1789 ElementCount EC = cast<VectorType>(Mask->getType())->getElementCount(); in getShuffleMask()
1791 if (isa<ConstantAggregateZero>(Mask)) { in getShuffleMask()
1799 assert((isa<ConstantAggregateZero>(Mask) || isa<UndefValue>(Mask)) && in getShuffleMask()
1801 int MaskVal = isa<UndefValue>(Mask) ? -1 : 0; in getShuffleMask()
1809 if (auto *CDS = dyn_cast<ConstantDataSequential>(Mask)) { in getShuffleMask()
1815 Constant *C = Mask->getAggregateElement(i); in getShuffleMask()
1821 void ShuffleVectorInst::setShuffleMask(ArrayRef<int> Mask) { in setShuffleMask() argument
1822 ShuffleMask.assign(Mask.begin(), Mask.end()); in setShuffleMask()
1823 ShuffleMaskForBitcode = convertShuffleMaskForBitcode(Mask, getType()); in setShuffleMask()
1826 Constant *ShuffleVectorInst::convertShuffleMaskForBitcode(ArrayRef<int> Mask, in convertShuffleMaskForBitcode() argument
1830 assert(all_equal(Mask) && "Unexpected shuffle"); in convertShuffleMaskForBitcode()
1831 Type *VecTy = VectorType::get(Int32Ty, Mask.size(), true); in convertShuffleMaskForBitcode()
1832 if (Mask[0] == 0) in convertShuffleMaskForBitcode()
1837 for (int Elem : Mask) { in convertShuffleMaskForBitcode()
1846 static bool isSingleSourceMaskImpl(ArrayRef<int> Mask, int NumOpElts) { in isSingleSourceMaskImpl() argument
1847 assert(!Mask.empty() && "Shuffle mask must contain elements"); in isSingleSourceMaskImpl()
1850 for (int I : Mask) { in isSingleSourceMaskImpl()
1864 bool ShuffleVectorInst::isSingleSourceMask(ArrayRef<int> Mask, int NumSrcElts) { in isSingleSourceMask() argument
1867 return isSingleSourceMaskImpl(Mask, NumSrcElts); in isSingleSourceMask()
1870 static bool isIdentityMaskImpl(ArrayRef<int> Mask, int NumOpElts) { in isIdentityMaskImpl() argument
1871 if (!isSingleSourceMaskImpl(Mask, NumOpElts)) in isIdentityMaskImpl()
1873 for (int i = 0, NumMaskElts = Mask.size(); i < NumMaskElts; ++i) { in isIdentityMaskImpl()
1874 if (Mask[i] == -1) in isIdentityMaskImpl()
1876 if (Mask[i] != i && Mask[i] != (NumOpElts + i)) in isIdentityMaskImpl()
1882 bool ShuffleVectorInst::isIdentityMask(ArrayRef<int> Mask, int NumSrcElts) { in isIdentityMask() argument
1883 if (Mask.size() != static_cast<unsigned>(NumSrcElts)) in isIdentityMask()
1887 return isIdentityMaskImpl(Mask, NumSrcElts); in isIdentityMask()
1890 bool ShuffleVectorInst::isReverseMask(ArrayRef<int> Mask, int NumSrcElts) { in isReverseMask() argument
1891 if (Mask.size() != static_cast<unsigned>(NumSrcElts)) in isReverseMask()
1893 if (!isSingleSourceMask(Mask, NumSrcElts)) in isReverseMask()
1900 for (int I = 0, E = Mask.size(); I < E; ++I) { in isReverseMask()
1901 if (Mask[I] == -1) in isReverseMask()
1903 if (Mask[I] != (NumSrcElts - 1 - I) && in isReverseMask()
1904 Mask[I] != (NumSrcElts + NumSrcElts - 1 - I)) in isReverseMask()
1910 bool ShuffleVectorInst::isZeroEltSplatMask(ArrayRef<int> Mask, int NumSrcElts) { in isZeroEltSplatMask() argument
1911 if (Mask.size() != static_cast<unsigned>(NumSrcElts)) in isZeroEltSplatMask()
1913 if (!isSingleSourceMask(Mask, NumSrcElts)) in isZeroEltSplatMask()
1915 for (int I = 0, E = Mask.size(); I < E; ++I) { in isZeroEltSplatMask()
1916 if (Mask[I] == -1) in isZeroEltSplatMask()
1918 if (Mask[I] != 0 && Mask[I] != NumSrcElts) in isZeroEltSplatMask()
1924 bool ShuffleVectorInst::isSelectMask(ArrayRef<int> Mask, int NumSrcElts) { in isSelectMask() argument
1925 if (Mask.size() != static_cast<unsigned>(NumSrcElts)) in isSelectMask()
1928 if (isSingleSourceMask(Mask, NumSrcElts)) in isSelectMask()
1930 for (int I = 0, E = Mask.size(); I < E; ++I) { in isSelectMask()
1931 if (Mask[I] == -1) in isSelectMask()
1933 if (Mask[I] != I && Mask[I] != (NumSrcElts + I)) in isSelectMask()
1939 bool ShuffleVectorInst::isTransposeMask(ArrayRef<int> Mask, int NumSrcElts) { in isTransposeMask() argument
1946 if (Mask.size() != static_cast<unsigned>(NumSrcElts)) in isTransposeMask()
1949 int Sz = Mask.size(); in isTransposeMask()
1954 if (Mask[0] != 0 && Mask[0] != 1) in isTransposeMask()
1959 if ((Mask[1] - Mask[0]) != NumSrcElts) in isTransposeMask()
1965 int MaskEltVal = Mask[I]; in isTransposeMask()
1968 int MaskEltPrevVal = Mask[I - 2]; in isTransposeMask()
1975 bool ShuffleVectorInst::isSpliceMask(ArrayRef<int> Mask, int NumSrcElts, in isSpliceMask() argument
1977 if (Mask.size() != static_cast<unsigned>(NumSrcElts)) in isSpliceMask()
1981 for (int I = 0, E = Mask.size(); I != E; ++I) { in isSpliceMask()
1982 int MaskEltVal = Mask[I]; in isSpliceMask()
2009 bool ShuffleVectorInst::isExtractSubvectorMask(ArrayRef<int> Mask, in isExtractSubvectorMask() argument
2012 if (!isSingleSourceMaskImpl(Mask, NumSrcElts)) in isExtractSubvectorMask()
2016 if (NumSrcElts <= (int)Mask.size()) in isExtractSubvectorMask()
2021 for (int i = 0, e = Mask.size(); i != e; ++i) { in isExtractSubvectorMask()
2022 int M = Mask[i]; in isExtractSubvectorMask()
2031 if (0 <= SubIndex && SubIndex + (int)Mask.size() <= NumSrcElts) { in isExtractSubvectorMask()
2038 bool ShuffleVectorInst::isInsertSubvectorMask(ArrayRef<int> Mask, in isInsertSubvectorMask() argument
2041 int NumMaskElts = Mask.size(); in isInsertSubvectorMask()
2048 if (isSingleSourceMaskImpl(Mask, NumSrcElts)) in isInsertSubvectorMask()
2059 int M = Mask[i]; in isInsertSubvectorMask()
2088 ArrayRef<int> Sub1Mask = Mask.slice(Src1Lo, NumSub1Elts); in isInsertSubvectorMask()
2100 ArrayRef<int> Sub0Mask = Mask.slice(Src0Lo, NumSub0Elts); in isInsertSubvectorMask()
2123 ArrayRef<int> Mask = getShuffleMask(); in isIdentityWithPadding() local
2124 if (!isIdentityMaskImpl(Mask, NumOpElts)) in isIdentityWithPadding()
2129 if (Mask[i] != -1) in isIdentityWithPadding()
2171 static bool isReplicationMaskWithParams(ArrayRef<int> Mask, in isReplicationMaskWithParams() argument
2173 assert(Mask.size() == (unsigned)ReplicationFactor * VF && in isReplicationMaskWithParams()
2177 ArrayRef<int> CurrSubMask = Mask.take_front(ReplicationFactor); in isReplicationMaskWithParams()
2180 Mask = Mask.drop_front(ReplicationFactor); in isReplicationMaskWithParams()
2186 assert(Mask.empty() && "Did not consume the whole mask?"); in isReplicationMaskWithParams()
2191 bool ShuffleVectorInst::isReplicationMask(ArrayRef<int> Mask, in isReplicationMask() argument
2194 if (!llvm::is_contained(Mask, PoisonMaskElem)) { in isReplicationMask()
2196 Mask.take_while([](int MaskElt) { return MaskElt == 0; }).size(); in isReplicationMask()
2197 if (ReplicationFactor == 0 || Mask.size() % ReplicationFactor != 0) in isReplicationMask()
2199 VF = Mask.size() / ReplicationFactor; in isReplicationMask()
2200 return isReplicationMaskWithParams(Mask, ReplicationFactor, VF); in isReplicationMask()
2211 for (int MaskElt : Mask) { in isReplicationMask()
2222 reverse(seq_inclusive<unsigned>(1, Mask.size()))) { in isReplicationMask()
2223 if (Mask.size() % PossibleReplicationFactor != 0) in isReplicationMask()
2225 int PossibleVF = Mask.size() / PossibleReplicationFactor; in isReplicationMask()
2226 if (!isReplicationMaskWithParams(Mask, PossibleReplicationFactor, in isReplicationMask()
2252 bool ShuffleVectorInst::isOneUseSingleSourceMask(ArrayRef<int> Mask, int VF) { in isOneUseSingleSourceMask() argument
2253 if (VF <= 0 || Mask.size() < static_cast<unsigned>(VF) || in isOneUseSingleSourceMask()
2254 Mask.size() % VF != 0) in isOneUseSingleSourceMask()
2256 for (unsigned K = 0, Sz = Mask.size(); K < Sz; K += VF) { in isOneUseSingleSourceMask()
2257 ArrayRef<int> SubMask = Mask.slice(K, VF); in isOneUseSingleSourceMask()
2295 ArrayRef<int> Mask, unsigned Factor, unsigned NumInputElts, in isInterleaveMask() argument
2297 unsigned NumElts = Mask.size(); in isInterleaveMask()
2320 int LaneValue = Mask[Lane]; in isInterleaveMask()
2321 int NextLaneValue = Mask[NextLane]; in isInterleaveMask()
2351 if (Mask[I] >= 0) { in isInterleaveMask()
2353 StartMask = Mask[I]; in isInterleaveMask()
2354 } else if (Mask[(LaneLen - 1) * Factor + I] >= 0) { in isInterleaveMask()
2356 StartMask = Mask[(LaneLen - 1) * Factor + I] - J; in isInterleaveMask()
2378 bool ShuffleVectorInst::isDeInterleaveMaskOfFactor(ArrayRef<int> Mask, in isDeInterleaveMaskOfFactor() argument
2387 for (; I < Mask.size(); I++) in isDeInterleaveMaskOfFactor()
2388 if (Mask[I] >= 0 && static_cast<unsigned>(Mask[I]) != Idx + I * Factor) in isDeInterleaveMaskOfFactor()
2391 if (I == Mask.size()) { in isDeInterleaveMaskOfFactor()
2404 static int matchShuffleAsBitRotate(ArrayRef<int> Mask, int NumSubElts) { in matchShuffleAsBitRotate() argument
2405 int NumElts = Mask.size(); in matchShuffleAsBitRotate()
2411 int M = Mask[i + j]; in matchShuffleAsBitRotate()
2426 ArrayRef<int> Mask, unsigned EltSizeInBits, unsigned MinSubElts, in isBitRotateMask() argument
2429 int EltRotateAmt = matchShuffleAsBitRotate(Mask, NumSubElts); in isBitRotateMask()