[LLVMdev] "Rotate Loop" pass kills "llvm.vectorizer.enable" metadata

Hal Finkel hfinkel at anl.gov
Mon Apr 7 06:30:54 PDT 2014


----- Original Message -----
> From: "Zinovy Nis" <zinovy.nis at gmail.com>
> To: llvmdev at cs.uiuc.edu
> Sent: Monday, April 7, 2014 8:13:34 AM
> Subject: [LLVMdev] "Rotate Loop" pass kills "llvm.vectorizer.enable" metadata
> 
> 
> 
> Hi.
> 
> 
> I faced that " llvm.vectorizer.enable" metadata used by Loop
> Vectorizer and set by OpenMP pragmas are killed after the "Rotate
> Loop" pass. The branch containing the metadata is replaced with
> another one, but without any metadata.
> So "Loop Vectorizer" doesn't force vectorization of this loop.
> 
> 
> I can fix it of course by propagating the metadata to the new branch
> from the old one, but there's no guarantee that some other pass will
> not kill at again.
> 
> 
> May be we need more reliable way for setting metadata for such cases?

No, I think that updating the metadata in the pass is the right solution. The idea behind metadata is that passes that affect instructions, but don't explicitly understand the metadata, should drop the metadata. That is what insures semantic correctness.

That having been said, in this case, are you pointing out that, generally, passes that replace the loop backedge should not drop the loop id metadata? Generally, I agree, but I'm not sure there is a lot of code-level generalization here. That having been said, if there is some way that the LoopInfo can take care of this automatically in a way that will always be correct, that sounds good too.

 -Hal

> 
> 
> - Zinovy.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 

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



More information about the llvm-dev mailing list