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

Arnold Schwaighofer aschwaighofer at apple.com
Sat Feb 9 11:52:43 PST 2013


They are related. This one is about modeling the cost of reverse shuffles correctly.

I will update the cost of v8i16 and v16i8 when I commit this patch. It all depends which patch goes in first :).

The code for checking is similar but not the same because they are at different stages of lowering.

On Feb 9, 2013, at 1:37 PM, Renato Golin <renato.golin at linaro.org> wrote:

> I'm guessing this could be used in your other patch about detecting reverse stride, are they related or conflicting?
> 
> --renato
> 
> 
> On 8 February 2013 18:40, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:
> Updated patch.
> 
> 
> 
> 
> 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
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130209/b0344fa8/attachment.html>


More information about the llvm-commits mailing list