@@ -2068,32 +2068,30 @@ class ShuffleVectorInst : public Instruction {
20682068 // / Return true if this shuffle mask chooses elements from exactly one source
20692069 // / vector.
20702070 // / Example: <7,5,undef,7>
2071- // / This assumes that vector operands (of length \p NumSrcElts) are the same
2072- // / length as the mask.
2073- static bool isSingleSourceMask (ArrayRef<int > Mask, int NumSrcElts);
2074- static bool isSingleSourceMask (const Constant *Mask, int NumSrcElts) {
2071+ // / This assumes that vector operands are the same length as the mask.
2072+ static bool isSingleSourceMask (ArrayRef<int > Mask);
2073+ static bool isSingleSourceMask (const Constant *Mask) {
20752074 assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
20762075 SmallVector<int , 16 > MaskAsInts;
20772076 getShuffleMask (Mask, MaskAsInts);
2078- return isSingleSourceMask (MaskAsInts, NumSrcElts );
2077+ return isSingleSourceMask (MaskAsInts);
20792078 }
20802079
20812080 // / Return true if this shuffle chooses elements from exactly one source
20822081 // / vector without changing the length of that vector.
20832082 // / Example: shufflevector <4 x n> A, <4 x n> B, <3,0,undef,3>
20842083 // / TODO: Optionally allow length-changing shuffles.
20852084 bool isSingleSource () const {
2086- return !changesLength () &&
2087- isSingleSourceMask (ShuffleMask, ShuffleMask.size ());
2085+ return !changesLength () && isSingleSourceMask (ShuffleMask);
20882086 }
20892087
20902088 // / Return true if this shuffle mask chooses elements from exactly one source
20912089 // / vector without lane crossings. A shuffle using this mask is not
20922090 // / necessarily a no-op because it may change the number of elements from its
20932091 // / input vectors or it may provide demanded bits knowledge via undef lanes.
20942092 // / Example: <undef,undef,2,3>
2095- static bool isIdentityMask (ArrayRef<int > Mask, int NumSrcElts );
2096- static bool isIdentityMask (const Constant *Mask, int NumSrcElts ) {
2093+ static bool isIdentityMask (ArrayRef<int > Mask);
2094+ static bool isIdentityMask (const Constant *Mask) {
20972095 assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
20982096
20992097 // Not possible to express a shuffle mask for a scalable vector for this
@@ -2103,7 +2101,7 @@ class ShuffleVectorInst : public Instruction {
21032101
21042102 SmallVector<int , 16 > MaskAsInts;
21052103 getShuffleMask (Mask, MaskAsInts);
2106- return isIdentityMask (MaskAsInts, NumSrcElts );
2104+ return isIdentityMask (MaskAsInts);
21072105 }
21082106
21092107 // / Return true if this shuffle chooses elements from exactly one source
@@ -2116,7 +2114,7 @@ class ShuffleVectorInst : public Instruction {
21162114 if (isa<ScalableVectorType>(getType ()))
21172115 return false ;
21182116
2119- return !changesLength () && isIdentityMask (ShuffleMask, ShuffleMask. size () );
2117+ return !changesLength () && isIdentityMask (ShuffleMask);
21202118 }
21212119
21222120 // / Return true if this shuffle lengthens exactly one source vector with
@@ -2140,12 +2138,12 @@ class ShuffleVectorInst : public Instruction {
21402138 // / In that case, the shuffle is better classified as an identity shuffle.
21412139 // / This assumes that vector operands are the same length as the mask
21422140 // / (a length-changing shuffle can never be equivalent to a vector select).
2143- static bool isSelectMask (ArrayRef<int > Mask, int NumSrcElts );
2144- static bool isSelectMask (const Constant *Mask, int NumSrcElts ) {
2141+ static bool isSelectMask (ArrayRef<int > Mask);
2142+ static bool isSelectMask (const Constant *Mask) {
21452143 assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
21462144 SmallVector<int , 16 > MaskAsInts;
21472145 getShuffleMask (Mask, MaskAsInts);
2148- return isSelectMask (MaskAsInts, NumSrcElts );
2146+ return isSelectMask (MaskAsInts);
21492147 }
21502148
21512149 // / Return true if this shuffle chooses elements from its source vectors
@@ -2157,41 +2155,39 @@ class ShuffleVectorInst : public Instruction {
21572155 // / In that case, the shuffle is better classified as an identity shuffle.
21582156 // / TODO: Optionally allow length-changing shuffles.
21592157 bool isSelect () const {
2160- return !changesLength () && isSelectMask (ShuffleMask, ShuffleMask. size () );
2158+ return !changesLength () && isSelectMask (ShuffleMask);
21612159 }
21622160
21632161 // / Return true if this shuffle mask swaps the order of elements from exactly
21642162 // / one source vector.
21652163 // / Example: <7,6,undef,4>
2166- // / This assumes that vector operands (of length \p NumSrcElts) are the same
2167- // / length as the mask.
2168- static bool isReverseMask (ArrayRef<int > Mask, int NumSrcElts);
2169- static bool isReverseMask (const Constant *Mask, int NumSrcElts) {
2164+ // / This assumes that vector operands are the same length as the mask.
2165+ static bool isReverseMask (ArrayRef<int > Mask);
2166+ static bool isReverseMask (const Constant *Mask) {
21702167 assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
21712168 SmallVector<int , 16 > MaskAsInts;
21722169 getShuffleMask (Mask, MaskAsInts);
2173- return isReverseMask (MaskAsInts, NumSrcElts );
2170+ return isReverseMask (MaskAsInts);
21742171 }
21752172
21762173 // / Return true if this shuffle swaps the order of elements from exactly
21772174 // / one source vector.
21782175 // / Example: shufflevector <4 x n> A, <4 x n> B, <3,undef,1,undef>
21792176 // / TODO: Optionally allow length-changing shuffles.
21802177 bool isReverse () const {
2181- return !changesLength () && isReverseMask (ShuffleMask, ShuffleMask. size () );
2178+ return !changesLength () && isReverseMask (ShuffleMask);
21822179 }
21832180
21842181 // / Return true if this shuffle mask chooses all elements with the same value
21852182 // / as the first element of exactly one source vector.
21862183 // / Example: <4,undef,undef,4>
2187- // / This assumes that vector operands (of length \p NumSrcElts) are the same
2188- // / length as the mask.
2189- static bool isZeroEltSplatMask (ArrayRef<int > Mask, int NumSrcElts);
2190- static bool isZeroEltSplatMask (const Constant *Mask, int NumSrcElts) {
2184+ // / This assumes that vector operands are the same length as the mask.
2185+ static bool isZeroEltSplatMask (ArrayRef<int > Mask);
2186+ static bool isZeroEltSplatMask (const Constant *Mask) {
21912187 assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
21922188 SmallVector<int , 16 > MaskAsInts;
21932189 getShuffleMask (Mask, MaskAsInts);
2194- return isZeroEltSplatMask (MaskAsInts, NumSrcElts );
2190+ return isZeroEltSplatMask (MaskAsInts);
21952191 }
21962192
21972193 // / Return true if all elements of this shuffle are the same value as the
@@ -2201,8 +2197,7 @@ class ShuffleVectorInst : public Instruction {
22012197 // / TODO: Optionally allow length-changing shuffles.
22022198 // / TODO: Optionally allow splats from other elements.
22032199 bool isZeroEltSplat () const {
2204- return !changesLength () &&
2205- isZeroEltSplatMask (ShuffleMask, ShuffleMask.size ());
2200+ return !changesLength () && isZeroEltSplatMask (ShuffleMask);
22062201 }
22072202
22082203 // / Return true if this shuffle mask is a transpose mask.
@@ -2237,12 +2232,12 @@ class ShuffleVectorInst : public Instruction {
22372232 // / ; Transposed matrix
22382233 // / t0 = < a, e, c, g > = shufflevector m0, m1 < 0, 4, 2, 6 >
22392234 // / t1 = < b, f, d, h > = shufflevector m0, m1 < 1, 5, 3, 7 >
2240- static bool isTransposeMask (ArrayRef<int > Mask, int NumSrcElts );
2241- static bool isTransposeMask (const Constant *Mask, int NumSrcElts ) {
2235+ static bool isTransposeMask (ArrayRef<int > Mask);
2236+ static bool isTransposeMask (const Constant *Mask) {
22422237 assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
22432238 SmallVector<int , 16 > MaskAsInts;
22442239 getShuffleMask (Mask, MaskAsInts);
2245- return isTransposeMask (MaskAsInts, NumSrcElts );
2240+ return isTransposeMask (MaskAsInts);
22462241 }
22472242
22482243 // / Return true if this shuffle transposes the elements of its inputs without
@@ -2251,30 +2246,27 @@ class ShuffleVectorInst : public Instruction {
22512246 // / exact specification.
22522247 // / Example: shufflevector <4 x n> A, <4 x n> B, <0,4,2,6>
22532248 bool isTranspose () const {
2254- return !changesLength () && isTransposeMask (ShuffleMask, ShuffleMask. size () );
2249+ return !changesLength () && isTransposeMask (ShuffleMask);
22552250 }
22562251
22572252 // / Return true if this shuffle mask is a splice mask, concatenating the two
22582253 // / inputs together and then extracts an original width vector starting from
22592254 // / the splice index.
22602255 // / Example: shufflevector <4 x n> A, <4 x n> B, <1,2,3,4>
2261- // / This assumes that vector operands (of length \p NumSrcElts) are the same
2262- // / length as the mask.
2263- static bool isSpliceMask (ArrayRef<int > Mask, int NumSrcElts, int &Index);
2264- static bool isSpliceMask (const Constant *Mask, int NumSrcElts, int &Index) {
2256+ static bool isSpliceMask (ArrayRef<int > Mask, int &Index);
2257+ static bool isSpliceMask (const Constant *Mask, int &Index) {
22652258 assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
22662259 SmallVector<int , 16 > MaskAsInts;
22672260 getShuffleMask (Mask, MaskAsInts);
2268- return isSpliceMask (MaskAsInts, NumSrcElts, Index);
2261+ return isSpliceMask (MaskAsInts, Index);
22692262 }
22702263
22712264 // / Return true if this shuffle splices two inputs without changing the length
22722265 // / of the vectors. This operation concatenates the two inputs together and
22732266 // / then extracts an original width vector starting from the splice index.
22742267 // / Example: shufflevector <4 x n> A, <4 x n> B, <1,2,3,4>
22752268 bool isSplice (int &Index) const {
2276- return !changesLength () &&
2277- isSpliceMask (ShuffleMask, ShuffleMask.size (), Index);
2269+ return !changesLength () && isSpliceMask (ShuffleMask, Index);
22782270 }
22792271
22802272 // / Return true if this shuffle mask is an extract subvector mask.
0 commit comments