llvm::createStrideMask

Create a stride shuffle mask.

Synopsis

Declared in <llvm/Analysis/VectorUtils.h>

llvm::SmallVector<int, 16>
createStrideMask(
    unsigned int Start,
    unsigned int Stride,
    unsigned int VF);

Description

This function creates a shuffle mask whose elements begin at Start and are incremented by Stride. The mask can be used to deinterleave an interleaved vector into separate vectors of vectorization factor VF. The mask is of the form:

<Start, Start + Stride, ..., Start + Stride * (VF - 1)>

For example, the mask for Start = 0, Stride = 2, and VF = 4 is:

<0, 2, 4, 6>

Return Value

A stride shuffle mask of length VF.

Parameters

NameDescription
StartFirst index in the generated stride mask.
StrideDistance between consecutive mask indices.
VFNumber of indices in the generated mask.