[PATCH 1/2] Cost model: Add check for reverse shuffles to CostModel analysis

Arnold Schwaighofer aschwaighofer at apple.com
Fri Feb 8 10:40:00 PST 2013


Updated patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Cost-model-Add-check-for-reverse-shuffles-to-CostMod.patch
Type: application/octet-stream
Size: 1922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130208/1f245de1/attachment.obj>
-------------- next part --------------


Thanks

On Feb 8, 2013, at 11:44 AM, Nadav Rotem <nrotem at apple.com> wrote:

> LGTM!  A few minor comments:
> 
> There is an extra line break here. 
> 
> +
> +static bool isReverseVectorMask(SmallVector<int, 16> &Mask) {
> +  for (unsigned i = 0, MaskSize = Mask.size(); i < MaskSize; ++i)
> +    if (Mask[i] != (int)(MaskSize - 1 - i))
> +      return false;
> +  return true;
> +}
> +
> 
> We should also check for -1's in the mask. 
> 
> +    if (NumVecElems == Mask.size() &&
> +        isReverseVectorMask(Mask))
> 
> 
> The expression above can fit in one line. 
> 
> 
> Thanks,
> Nadav



More information about the llvm-commits mailing list