[LLVMdev] Vectorization metadata

Renato Golin rengolin at systemcall.org
Wed Apr 18 12:34:38 PDT 2012


On 18 April 2012 17:54, Hal Finkel <hfinkel at anl.gov> wrote:
> Metadata specifically for vectorization is another interesting topic,
> but I don't have any specific ideas for this at the moment. That having
> been said, I think that we do need to think about metadata that will
> help with vectorization; we might want to tag instructions as safe for
> speculative execution, for example. We might want to tag loops with a
> specific unrolling factor. We might want to be able to pass along
> specific alias independence results. None of these things are really
> specific to vectorization, but will generally have an impact on it.

I think this is a very important feature for vectorization. If we
start building small passes for small vectorization steps (like one
for hoisting loop constants, other to simplify the induction range,
other to unroll loops), we might not be able to predict the best
strategy, since early changes might shadow better strategies later.

Having metadata allows one to infer what's the best strategy as a
whole, and apply it, rather than hoping for a good sequence of
passes... We still can have separate passes for each task, but not run
them all on all code all the time.

So, if an early analysis pass annotate saying in a particular loop,
you should only hoist the loop-constants (aggressive inlining is
possible, for ex.), while on another you should actually unroll, then
each pass can run independently and trust the metadata on each
loop/block/instruction.

-- 
cheers,
--renato

http://systemcall.org/



More information about the llvm-dev mailing list