Map a shuffle's demanded outputs to demanded elements of its operands.

Synopsis

Declared in <llvm/Analysis/VectorUtils.h>

bool
getShuffleDemandedElts(
    int SrcWidth,
    ArrayRef<int> Mask,
    APInt const& DemandedElts,
    APInt& DemandedLHS,
    APInt& DemandedRHS,
    bool AllowUndefElts = false);

Description

Transform a shuffle mask's output demanded element mask into demanded element masks for the 2 operands, returns false if the mask isn't valid. Both DemandedLHS and DemandedRHS are initialised to [SrcWidth]. AllowUndefElts permits "‐1" indices to be treated as undef.

Return Value

True if the mask is valid and the demanded operands were computed.

Parameters

Name

Description

SrcWidth

Number of elements in each shuffle operand.

Mask

Shuffle mask being analyzed.

DemandedElts

Demanded elements of the shuffle result.

DemandedLHS

Output demanded elements of the left operand.

DemandedRHS

Output demanded elements of the right operand.

AllowUndefElts

Whether ‐1 mask indices may be treated as undef.

Created with MrDocs