[LLVMdev] Vectorization metadata

Hal Finkel hfinkel at anl.gov
Wed Apr 18 09:54:38 PDT 2012


On Wed, 18 Apr 2012 17:30:11 +0100
Renato Golin <rengolin at systemcall.org> wrote:

> Hal,
> 
> I'm opening a new discussion on vectorization metadata, since it has
> little to do with fp-math. ;)

Fair enough, but I was actually taking about how fp-math, etc. metadata
is updated during vectorization. When vectorization fuses
originally-independent instructions, it has the same metadata issues as
GVN, etc.

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.

 -Hal

> 
> What kind of metadata would you annotate in the instructions? If I
> remember from your talk, you're not doing any loop or whole-function
> analysis, possibly leaving it for Polly to help you along the way.
> 
> I remember discussing it with Tobias that Polly could have three main
> steps:
> 
> 1. Early analysis and annotation: a step that wouldn't modify code,
> but extensively annotate (with metadata), so that itself, and other
> passes like yours, could benefit from the polyhedral model.
> 
> 2. Full polyhedral code modification: use the annotation of the
> previous pass to extensively modify code. This is what Polly does
> today, but the result of the analysis is not benefiting anyone except
> for Polly.
> 
> This step can be fused with step 1 for performance reasons, but would
> be good to be able to pass only the analysis part
>  for the benefit of the annotation, without the heavy modifications.
> This will be fundamental for independently testing  vectorization
> passes that depend on Polly's metadata.
> 
> 3. Code generation steps. As you said in your talk, and we discussed
> in the fp-math thread, some code-generation steps could be aware of
> the optimizations done via the metadata that was left in it.
> 
> That will require some guarantees on metadata semantics and
> persistence that is not available today... Anyway, not sure any
> metadata-hardening will be very well accepted... ;)
> 



-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list