Zinovy Nis
2014-Apr-07 13:13 UTC
[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? - Zinovy. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140407/9921c637/attachment.html>
Hal Finkel
2014-Apr-07 13:30 UTC
[LLVMdev] "Rotate Loop" pass kills "llvm.vectorizer.enable" metadata
----- 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