Vector alignment tracking
Jakub Jelinek
jakub@redhat.com
Thu Oct 13 17:21:00 GMT 2011
On Thu, Oct 13, 2011 at 06:57:47PM +0200, Andi Kleen wrote:
> > Or I am missing someting?
>
> I often see the x86 vectorizer with -mtune=generic generate a lot of
> complicated code just to adjust for potential misalignment.
>
> My thought was just if the alias oracle knows what the original
> declaration is, and it's available for changes (e.g. LTO), it would be
> likely be better to just add an __attribute__((aligned()))
> there.
>
> In the general case it's probably harder, you would need some
> cost model to decide when it's worth it.
GCC already does that on certain targets, see
increase_alignment in tree-vectorizer.c. Plus, various backends attempt
to align larger arrays more than they have to be aligned.
Jakub
More information about the Gcc-patches
mailing list