PATCH: WIP SLPVectorize: Enable vectorization of allocas

Hal Finkel hfinkel at anl.gov
Fri Oct 25 01:14:13 PDT 2013


----- Original Message -----
> Hi Tom,
> 
> I am not sure that it is a good idea to generate ExtractElement
> instructions with dynamic indices at IR level. 

I think that we should handle this decision using TTI. ExtractElement with a dynamic index, in theory, seems like it should be the preferred canonical form. In practice, I suspect that preferring it without target input will lead to hard-to-fix regressions. On my target, I can generate dynamic EEs in a relatively inexpensive way (one integer op, one shuffle generation and one shuffle instruction), but for other targets, dynamic EEs are always expanded through stack-slot load/stores. In the latter case, these extra load/stores may not be removable by DAGCombine (even if they might otherwise be in this case) because the EE's input may have been moved into some predecessor BB.

 -Hal

> I think that this
> kind of patterns should be matched during instruction selection.
> Assuming that you can pattern match it during isel, you are still
> left with the alloca.  Allocas are lowered into stack slots and I
> think that we should be able to move stack slots that are only
> stored to.
> 
> Thanks,
> Nadav
> 
> 
> On Oct 24, 2013, at 9:02 PM, Tom Stellard <tom at stellard.net> wrote:
> 
> > Hi,
> > 
> > As a follow up to this discussion:
> > http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-October/066780.html
> > 
> > I put together a very simple patch that begins to implement the
> > transformation
> > mentioned in the llvm-dev thread.  The patch is incomplete and is
> > mostly comments
> > with question about how to do certain things, but it does work for
> > the
> > simple test case included in the patch.
> > 
> > I'd appreciate any feedback people can give me on this patch and
> > the
> > questions posed in the comments.
> > 
> > Thanks,
> > Tom
> > <vectorize-alloca.diff>
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list