Replace each shuffle mask index with scaled indices for narrower elements.

Synopsis

Declared in <llvm/Analysis/VectorUtils.h>

void
narrowShuffleMaskElts(
    int Scale,
    ArrayRef<int> Mask,
    SmallVectorImpl<int>& ScaledMask);

Description

Replace each shuffle mask index with the scaled sequential indices for an equivalent mask of narrowed elements. Mask elements that are less than 0 (sentinel values) are repeated in the output mask.

Example with Scale = 4: <4 x i32> <3, 2, 0, ‐1> ‐‐> <16 x i8> <12, 13, 14, 15, 8, 9, 10, 11, 0, 1, 2, 3, ‐1, ‐1, ‐1, ‐1>

This is the reverse process of widening shuffle mask elements, but it always succeeds because the indexes can always be multiplied (scaled up) to map to narrower vector elements.

Parameters

Name

Description

Scale

Factor by which each mask index is expanded.

Mask

Input shuffle mask over wide elements.

ScaledMask

Output shuffle mask over narrowed elements.

Created with MrDocs