[PATCH] Implement pragma llvm.vectorizer.enable in LoopVectorizer

Renato Golin renato.golin at linaro.org
Fri Nov 29 11:05:27 PST 2013


On 29 November 2013 17:23, Nadav Rotem <nrotem at apple.com> wrote:
> There are so many vectorization configurations: WIDTH x UNROLL, and
> selecting anything but scalar is not that usable. You either trust LLVM to
> select the best vectorization configuration for you, or you don’t. If you
> don’t trust LLVM’s heuristics then you can use the UNROLL and WIDTH pragmas
> to select specific configuration parameters. I don’t think that it makes
> sense to have a pragma that says that the vectorizer should select whatever
> it wants except for one specific configuration. The goal is not to see
> vector instructions in the code, the goal is to give the users tools to tune
> their code.

That's a good point.

I was basing my change on Arnold's document ("Enable vectorization
(e.g. at -Os) if cost model thinks it is a bad idea."). I guess I
misinterpreted it.


> Maybe the "#vectorize enable” should be a code block pragma, not a loop
> pragma. We could attach metadata to basic blocks and if a loop is dominated
> by a block with ‘enable’ metadata then vectorization should be allowed.

I can see how this would benefit the SLP, too.

I'll discard this current implementation and think about the global one.

cheers,
--renato




More information about the llvm-commits mailing list