@@ -2068,32 +2068,30 @@ class ShuffleVectorInst : public Instruction {
2068
2068
// / Return true if this shuffle mask chooses elements from exactly one source
2069
2069
// / vector.
2070
2070
// / 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) {
2075
2074
assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
2076
2075
SmallVector<int , 16 > MaskAsInts;
2077
2076
getShuffleMask (Mask, MaskAsInts);
2078
- return isSingleSourceMask (MaskAsInts, NumSrcElts );
2077
+ return isSingleSourceMask (MaskAsInts);
2079
2078
}
2080
2079
2081
2080
// / Return true if this shuffle chooses elements from exactly one source
2082
2081
// / vector without changing the length of that vector.
2083
2082
// / Example: shufflevector <4 x n> A, <4 x n> B, <3,0,undef,3>
2084
2083
// / TODO: Optionally allow length-changing shuffles.
2085
2084
bool isSingleSource () const {
2086
- return !changesLength () &&
2087
- isSingleSourceMask (ShuffleMask, ShuffleMask.size ());
2085
+ return !changesLength () && isSingleSourceMask (ShuffleMask);
2088
2086
}
2089
2087
2090
2088
// / Return true if this shuffle mask chooses elements from exactly one source
2091
2089
// / vector without lane crossings. A shuffle using this mask is not
2092
2090
// / necessarily a no-op because it may change the number of elements from its
2093
2091
// / input vectors or it may provide demanded bits knowledge via undef lanes.
2094
2092
// / 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) {
2097
2095
assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
2098
2096
2099
2097
// Not possible to express a shuffle mask for a scalable vector for this
@@ -2103,7 +2101,7 @@ class ShuffleVectorInst : public Instruction {
2103
2101
2104
2102
SmallVector<int , 16 > MaskAsInts;
2105
2103
getShuffleMask (Mask, MaskAsInts);
2106
- return isIdentityMask (MaskAsInts, NumSrcElts );
2104
+ return isIdentityMask (MaskAsInts);
2107
2105
}
2108
2106
2109
2107
// / Return true if this shuffle chooses elements from exactly one source
@@ -2116,7 +2114,7 @@ class ShuffleVectorInst : public Instruction {
2116
2114
if (isa<ScalableVectorType>(getType ()))
2117
2115
return false ;
2118
2116
2119
- return !changesLength () && isIdentityMask (ShuffleMask, ShuffleMask. size () );
2117
+ return !changesLength () && isIdentityMask (ShuffleMask);
2120
2118
}
2121
2119
2122
2120
// / Return true if this shuffle lengthens exactly one source vector with
@@ -2140,12 +2138,12 @@ class ShuffleVectorInst : public Instruction {
2140
2138
// / In that case, the shuffle is better classified as an identity shuffle.
2141
2139
// / This assumes that vector operands are the same length as the mask
2142
2140
// / (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) {
2145
2143
assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
2146
2144
SmallVector<int , 16 > MaskAsInts;
2147
2145
getShuffleMask (Mask, MaskAsInts);
2148
- return isSelectMask (MaskAsInts, NumSrcElts );
2146
+ return isSelectMask (MaskAsInts);
2149
2147
}
2150
2148
2151
2149
// / Return true if this shuffle chooses elements from its source vectors
@@ -2157,41 +2155,39 @@ class ShuffleVectorInst : public Instruction {
2157
2155
// / In that case, the shuffle is better classified as an identity shuffle.
2158
2156
// / TODO: Optionally allow length-changing shuffles.
2159
2157
bool isSelect () const {
2160
- return !changesLength () && isSelectMask (ShuffleMask, ShuffleMask. size () );
2158
+ return !changesLength () && isSelectMask (ShuffleMask);
2161
2159
}
2162
2160
2163
2161
// / Return true if this shuffle mask swaps the order of elements from exactly
2164
2162
// / one source vector.
2165
2163
// / 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) {
2170
2167
assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
2171
2168
SmallVector<int , 16 > MaskAsInts;
2172
2169
getShuffleMask (Mask, MaskAsInts);
2173
- return isReverseMask (MaskAsInts, NumSrcElts );
2170
+ return isReverseMask (MaskAsInts);
2174
2171
}
2175
2172
2176
2173
// / Return true if this shuffle swaps the order of elements from exactly
2177
2174
// / one source vector.
2178
2175
// / Example: shufflevector <4 x n> A, <4 x n> B, <3,undef,1,undef>
2179
2176
// / TODO: Optionally allow length-changing shuffles.
2180
2177
bool isReverse () const {
2181
- return !changesLength () && isReverseMask (ShuffleMask, ShuffleMask. size () );
2178
+ return !changesLength () && isReverseMask (ShuffleMask);
2182
2179
}
2183
2180
2184
2181
// / Return true if this shuffle mask chooses all elements with the same value
2185
2182
// / as the first element of exactly one source vector.
2186
2183
// / 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) {
2191
2187
assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
2192
2188
SmallVector<int , 16 > MaskAsInts;
2193
2189
getShuffleMask (Mask, MaskAsInts);
2194
- return isZeroEltSplatMask (MaskAsInts, NumSrcElts );
2190
+ return isZeroEltSplatMask (MaskAsInts);
2195
2191
}
2196
2192
2197
2193
// / Return true if all elements of this shuffle are the same value as the
@@ -2201,8 +2197,7 @@ class ShuffleVectorInst : public Instruction {
2201
2197
// / TODO: Optionally allow length-changing shuffles.
2202
2198
// / TODO: Optionally allow splats from other elements.
2203
2199
bool isZeroEltSplat () const {
2204
- return !changesLength () &&
2205
- isZeroEltSplatMask (ShuffleMask, ShuffleMask.size ());
2200
+ return !changesLength () && isZeroEltSplatMask (ShuffleMask);
2206
2201
}
2207
2202
2208
2203
// / Return true if this shuffle mask is a transpose mask.
@@ -2237,12 +2232,12 @@ class ShuffleVectorInst : public Instruction {
2237
2232
// / ; Transposed matrix
2238
2233
// / t0 = < a, e, c, g > = shufflevector m0, m1 < 0, 4, 2, 6 >
2239
2234
// / 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) {
2242
2237
assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
2243
2238
SmallVector<int , 16 > MaskAsInts;
2244
2239
getShuffleMask (Mask, MaskAsInts);
2245
- return isTransposeMask (MaskAsInts, NumSrcElts );
2240
+ return isTransposeMask (MaskAsInts);
2246
2241
}
2247
2242
2248
2243
// / Return true if this shuffle transposes the elements of its inputs without
@@ -2251,30 +2246,27 @@ class ShuffleVectorInst : public Instruction {
2251
2246
// / exact specification.
2252
2247
// / Example: shufflevector <4 x n> A, <4 x n> B, <0,4,2,6>
2253
2248
bool isTranspose () const {
2254
- return !changesLength () && isTransposeMask (ShuffleMask, ShuffleMask. size () );
2249
+ return !changesLength () && isTransposeMask (ShuffleMask);
2255
2250
}
2256
2251
2257
2252
// / Return true if this shuffle mask is a splice mask, concatenating the two
2258
2253
// / inputs together and then extracts an original width vector starting from
2259
2254
// / the splice index.
2260
2255
// / 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) {
2265
2258
assert (Mask->getType ()->isVectorTy () && " Shuffle needs vector constant." );
2266
2259
SmallVector<int , 16 > MaskAsInts;
2267
2260
getShuffleMask (Mask, MaskAsInts);
2268
- return isSpliceMask (MaskAsInts, NumSrcElts, Index);
2261
+ return isSpliceMask (MaskAsInts, Index);
2269
2262
}
2270
2263
2271
2264
// / Return true if this shuffle splices two inputs without changing the length
2272
2265
// / of the vectors. This operation concatenates the two inputs together and
2273
2266
// / then extracts an original width vector starting from the splice index.
2274
2267
// / Example: shufflevector <4 x n> A, <4 x n> B, <1,2,3,4>
2275
2268
bool isSplice (int &Index) const {
2276
- return !changesLength () &&
2277
- isSpliceMask (ShuffleMask, ShuffleMask.size (), Index);
2269
+ return !changesLength () && isSpliceMask (ShuffleMask, Index);
2278
2270
}
2279
2271
2280
2272
// / Return true if this shuffle mask is an extract subvector mask.
0 commit comments