Hi LLVMers, I am fairly new to the LLVM pass framework. My goal is to extend the CFGPrinter analysis pass to label the edges of the graph with their edge-counts from profile data. I can generate the CFGs using 'analyze', but I am having trouble loading the profile data. I added the line AU.addRequired<ProfileInfo>(); to the getAnalysisUsage. It is returning zero for all the edge counts. In llvm/Analysis/ProfileInfo.h, I noticed a prototype: Pass *createProfileLoaderPass(const std::string &Filename); The ProfileInfoLoaderPass does not appear in the list of analyses, presumably because it is registered as an "Opt". Do I need to explicitly request a LoaderPass in addition to ProfileInfo? What is the right way to do this? Thanks.
On Wed, 16 Mar 2005, Eric Zimmerman wrote:> Hi LLVMers, > > I am fairly new to the LLVM pass framework. My goal is to extend the > CFGPrinter analysis pass to label the edges of the graph with their > edge-counts from profile data. > > I can generate the CFGs using 'analyze', but I am having trouble > loading the profile data. I added the line > AU.addRequired<ProfileInfo>(); to the getAnalysisUsage. It is > returning zero for all the edge counts. > > In llvm/Analysis/ProfileInfo.h, I noticed a prototype: > Pass *createProfileLoaderPass(const std::string &Filename); > > The ProfileInfoLoaderPass does not appear in the list of analyses, > presumably because it is registered as an "Opt". Do I need to > explicitly request a LoaderPass in addition to ProfileInfo? What is > the right way to do this?Run opt with something like this: opt -profile-loader -profile-info-file=whatever.llvmprof -yourprofileusingpass ... -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
On Wed, Mar 16, 2005 at 09:16:20PM -0600, Chris Lattner wrote:> >I am fairly new to the LLVM pass framework. My goal is to extend the > >CFGPrinter analysis pass to label the edges of the graph with their > >edge-counts from profile data. > > > >I can generate the CFGs using 'analyze', but I am having trouble > >loading the profile data. I added the line > >AU.addRequired<ProfileInfo>(); to the getAnalysisUsage. It is > >returning zero for all the edge counts. > > > >In llvm/Analysis/ProfileInfo.h, I noticed a prototype: > >Pass *createProfileLoaderPass(const std::string &Filename); > > > >The ProfileInfoLoaderPass does not appear in the list of analyses, > >presumably because it is registered as an "Opt". Do I need to > >explicitly request a LoaderPass in addition to ProfileInfo? What is > >the right way to do this? > > > Run opt with something like this: > > opt -profile-loader -profile-info-file=whatever.llvmprof > -yourprofileusingpass ... >Chris, Thanks, that worked. For my own understanding, I wondered if using the opt command-line is the only way to request a ProfileInfoLoaderPass? What if I want to use this information in the 'analyze' utility instead of 'opt'? Also, rather than requesting the pass interactively, can I somehow use the constructor provided in ProfileInfo.h? Here is the prototype, but I'm not sure how to use it: Pass *createProfileLoaderPass(const std::string &Filename); -Eric
Maybe Matching Threads
- [LLVMdev] Loading ProfileInfo
- [LLVMdev] Loading ProfileInfo
- [LLVMdev] Loading ProfileInfo in Backend. (Was: [PATCH] & Question: Preserving ProfileInfo for backend.)
- [LLVMdev] Loading ProfileInfo in Backend. (Was: [PATCH] & Question: Preserving ProfileInfo for backend.)
- [LLVMdev] Loading ProfileInfo in Backend. (Was: [PATCH] & Question: Preserving ProfileInfo for backend.)