ΒΆbool widenShuffleMaskElts(
int Scale,
ArrayRef<int> Mask,
SmallVectorImpl<int>& ScaledMask)
bool widenShuffleMaskElts(
int Scale,
ArrayRef<int> Mask,
SmallVectorImpl<int>& ScaledMask)
Description
Try to transform a shuffle mask by replacing elements with the scaled index for an equivalent mask of widened elements. If all mask elements that would map to a wider element of the new mask are the same negative number (sentinel value), that element of the new mask is the same value. If any element in a given slice is negative and some other element in that slice is not the same value, return false (partial matches with sentinel values are not allowed). Example with Scale = 4: < 16 x i8> < 12, 13, 14, 15, 8, 9, 10, 11, 0, 1, 2, 3, -1, -1, -1, -1> --> < 4 x i32> < 3, 2, 0, -1> This is the reverse process of narrowing shuffle mask elements if it succeeds. This transform is not always possible because indexes may not divide evenly (scale down) to map to wider vector elements.
Declared at: llvm/include/llvm/Analysis/VectorUtils.h:398
Parameters
- int Scale
- ArrayRef<int> Mask
- SmallVectorImpl<int>& ScaledMask