Thanks, John. This sounds reasonable that the analysis group just provides an interface to its implementors (pass). Then I have another question, is it allowed to specify multiple pass in the same analysis group in the command line for opt? If yes, which pass will be used for the call of getAnaysis<AnalysisGroup>()? -Thomson On Mon, Jun 25, 2012 at 10:34 PM, John Criswell <criswell at illinois.edu>wrote:> On 6/24/12 10:37 AM, Thomson wrote: > > I found that ProfileInfo is contained in an analysis group, but > ProfileInfo class itself is not derived from any base classes of passes, so > it appears not to be a pass. Anything I missed here? > > > This is just a guess, but I suspect that the ProfileInfo class defines the > interface which all passes in that analysis group are expected to > implement. I think I've seen other analysis groups use this approach. > > -- John T. > > > Thanks, > -Thomson > > > _______________________________________________ > LLVM Developers mailing listLLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120626/db46b9b3/attachment.html>
On 6/25/12 8:55 PM, Thomson wrote:> Thanks, John. > > This sounds reasonable that the analysis group just provides an > interface to its implementors (pass). Then I have another question, is > it allowed to specify multiple pass in the same analysis group in the > command line for opt?Yes, you can do that. Using multiple analysis passes that belong to the same group may be useful when using chained analyses (like points-to analysis) in which one analysis tries to get a result and, if it can't get as good a result as it likes, asks the next analysis in the chain (see http://llvm.org/docs/WritingAnLLVMPass.html#AU::addRequired).> If yes, which pass will be used for the call of > getAnaysis<AnalysisGroup>()?I believe the chain is in reverse order. So if you specify opt -pass1 -pass2 -pass3 -transform, and transform queries the analysis group to which pass1, pass2, and pass3 belong, then pass3 is queried first. If pass3 then queries another pass in the analysis group, the query will be sent to pass2. Likewise, if pass2 queries another analysis in the group, it will be sent to pass1. -- John T.> > -Thomson > > On Mon, Jun 25, 2012 at 10:34 PM, John Criswell <criswell at illinois.edu > <mailto:criswell at illinois.edu>> wrote: > > On 6/24/12 10:37 AM, Thomson wrote: >> I found that ProfileInfo is contained in an analysis group, but >> ProfileInfo class itself is not derived from any base classes of >> passes, so it appears not to be a pass. Anything I missed here? > > This is just a guess, but I suspect that the ProfileInfo class > defines the interface which all passes in that analysis group are > expected to implement. I think I've seen other analysis groups > use this approach. > > -- John T. > >> >> Thanks, >> -Thomson >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120626/9561a8a3/attachment.html>
Thanks for your detail explanation. Just one more question, the chain of passes in an analysis group is implemented in PassManager and not in the specific pass, so any specific pass doesn't assume there is any other passes in the same analysis group, is this right? -Thomson On Tue, Jun 26, 2012 at 10:33 PM, John Criswell <criswell at illinois.edu>wrote:> On 6/25/12 8:55 PM, Thomson wrote: > > Thanks, John. > > This sounds reasonable that the analysis group just provides an > interface to its implementors (pass). Then I have another question, is it > allowed to specify multiple pass in the same analysis group in the command > line for opt? > > > Yes, you can do that. Using multiple analysis passes that belong to the > same group may be useful when using chained analyses (like points-to > analysis) in which one analysis tries to get a result and, if it can't get > as good a result as it likes, asks the next analysis in the chain (see > http://llvm.org/docs/WritingAnLLVMPass.html#AU::addRequired). > > > If yes, which pass will be used for the call of > getAnaysis<AnalysisGroup>()? > > > I believe the chain is in reverse order. So if you specify opt -pass1 > -pass2 -pass3 -transform, and transform queries the analysis group to which > pass1, pass2, and pass3 belong, then pass3 is queried first. If pass3 then > queries another pass in the analysis group, the query will be sent to > pass2. Likewise, if pass2 queries another analysis in the group, it will > be sent to pass1. > > -- John T. > > > > -Thomson > > On Mon, Jun 25, 2012 at 10:34 PM, John Criswell <criswell at illinois.edu>wrote: > >> On 6/24/12 10:37 AM, Thomson wrote: >> >> I found that ProfileInfo is contained in an analysis group, but >> ProfileInfo class itself is not derived from any base classes of passes, so >> it appears not to be a pass. Anything I missed here? >> >> >> This is just a guess, but I suspect that the ProfileInfo class defines >> the interface which all passes in that analysis group are expected to >> implement. I think I've seen other analysis groups use this approach. >> >> -- John T. >> >> >> Thanks, >> -Thomson >> >> >> _______________________________________________ >> LLVM Developers mailing listLLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >> >> > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120626/850db957/attachment.html>