search for: getanalysis

Displaying 20 results from an estimated 524 matches for "getanalysis".

2018 Jan 28
4
Polly Dependency Analysis in MyPass
...but when i execute this pass in gdb i get no data. Why is that so? My code is follows; namespace { struct mypass : public FunctionPass { static char ID; mypass() : FunctionPass(ID) { } virtual bool runOnFunction(Function &F) { polly::DependenceInfoWrapperPass dp; auto &SI = *getAnalysis<polly::ScopInfoWrapperPass>().getSI(); for (auto &It : SI) { assert(It.second && "Invalid SCoP object!"); dp.recomputeDependences(It.second.get(), polly::Dependences::AL_Access); } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addR...
2018 Jan 28
0
Polly Dependency Analysis in MyPass
...lows; now i am using both scopdetection and scopinformation before dependency check but i think link is missing... virtual bool runOnFunction(Function &F) { std::unique_ptr<ScopInfo> Result; std::unique_ptr<ScopDetection> Result2; //polly::ScopDetection pl; auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); auto &RI = getAnalysis<RegionInfoPass>().getRegionInfo(); auto &AA = getAnalysis<AAResultsWrapperPass>().getAAResults(); auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE(); auto &DT = getAnalysis<Domi...
2012 Mar 09
3
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
Thank you for your quick reply. Actually I am using a std::map to map Function* to LoopInfo*, but that does not help in this case. Each time I call getAnalysis<llvm::LoopInfo>(*F), it returns the same instance of llvm::LoopInfo, so the std::map is just mapping every function into the same instance. It seems only the analysis result for the last function is valid, because all the result for all previous functions are erased. The only workaround solu...
2018 Jan 28
1
Polly Dependency Analysis in MyPass
...; scopinformation before dependency check but i think link is missing... > > virtual bool runOnFunction(Function &F) > { > > std::unique_ptr<ScopInfo> Result; > std::unique_ptr<ScopDetection> Result2; > //polly::ScopDetection pl; > > auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); > auto &RI = getAnalysis<RegionInfoPass>().getRegionInfo(); > auto &AA = getAnalysis<AAResultsWrapperPass>().getAAResults(); > auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE(); > auto &DT =...
2012 Mar 09
0
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
On 3/9/12 4:28 PM, Fan Long wrote: > Thank you for your quick reply. > > Actually I am using a std::map to map Function* to LoopInfo*, but that > does not help in this case. Each time I call > getAnalysis<llvm::LoopInfo>(*F), it returns the same instance of > llvm::LoopInfo, so the std::map is just mapping every function into > the same instance. It seems only the analysis result for the last > function is valid, because all the result for all previous functions > are erased....
2019 Mar 26
2
On-the-fly passes
...n a ModulePass I've created. To support both the legacy and new pass managers, I've abstracted away the code to get the passes it depends on: bool MyPass::runOnModule(Module &M) override { auto DominatorGetter = [this] (Function &F) -> DominatorTree & { return this->getAnalysis<DominatorTreeWrapperPass>(F).getDomTree(); }; auto PostDominatorGetter = [this] (Function &F) -> PostDominatorTree & { return this-> getAnalysis<PostDominatorTreeWrapperPass>(F).getPostDomTree(); }; auto LoopInfoGetter = [this] (Functi...
2011 Nov 08
2
[LLVMdev] loadable passes with dependencies?
I still have the addRequired: virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<DominatorTree>(); } The other line DominatorTree *dt = &getAnalysis<DominatorTree>(); Is for later use when I try to use PromoteMemToReg On Tue, Nov 8, 2011 at 4:22 PM, Michael Ilseman <michael at luna...
2016 Jan 22
3
LLVM - getAnalysisUsage()
...=Structure, and found the following: ModulePass Manager X Analysis Unnamed pass: implement Pass::getPassName() FunctionPass Manager Module Verifier Bitcode Writer Pass Arguments: -x -y -z FunctionPass Manager X Analysis Y Construction Z Construction Even for getAnalysis<Y>(*F) and getAnalysis<Z>(&F), all the passes X, Y, Z are executed again. In total there are three places where getAnalysis() directive has been used for X, Y, Z. However, for each getAnalysis() call, all three passes are scheduled/executed. On Fri, Jan 22, 2016 at 12:24 PM, Meh...
2008 Nov 30
3
[LLVMdev] Error when using getAnalysis
Hi, I'm trying to use the function getAnalysis. This is the code I'm using : void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<LoopInfo>(); AU.setPreservesAll(); } virtual bool runOnModule(Module &M) { LoopInfo &LI = getAnalysis<LoopInfo>(); } I get following error when...
2011 Nov 09
1
[LLVMdev] loadable passes with dependencies?
Awesome, that let me get far enough to trip: Assertion failed: (ResultPass && "Unable to find requested analysis info"), function getAnalysisID Is there something else I forgot? On Tue, Nov 8, 2011 at 5:47 PM, John Criswell <criswell at illinois.edu> wrote: > On 11/8/11 4:34 PM, ret val wrote: >> >> I still have the addRequired: >>         virtual void getAnalysisUsage(AnalysisUsage&AU) const { >>  ...
2011 Nov 08
0
[LLVMdev] loadable passes with dependencies?
On 11/8/11 4:34 PM, ret val wrote: > I still have the addRequired: > virtual void getAnalysisUsage(AnalysisUsage&AU) const { > AU.addRequired<DominatorTree>(); > } > > The other line > DominatorTree *dt =&getAnalysis<DominatorTree>(); > Is for later use when I try to use PromoteMemToReg Isn't DominatorTree a FunctionPas...
2012 Mar 13
2
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
Hi John & Fan, I hit the exact same problem today. I can confirm that Fan's observation of getting the *same* LoopInfo* from subsequent calls to getAnalysis<LoopInfo>(function) for *distinct* functions is indeed true. I was very surprised by this at first as well, but I think I've found an explanation - please anyone correct me if this is wrong: What you're getting from getAnalysis<>(function) is a reference to the function pass a...
2011 Nov 08
4
[LLVMdev] loadable passes with dependencies?
Just shows me what I expect void getAnalysisUsage(AnalysisUsage &AU) const { DominatorTree *dt = &getAnalysis<DominatorTree>(); So I'm only using it for DominatorTree(so I can use PromoteMemToReg). Thanks On Tue, Nov 8, 2011 at 2:28 PM, Tobias Grosser <tobias at grosser.es> wrote: > On 11/08/2011 07:33 PM, ret...
2010 Sep 15
2
[LLVMdev] getAnalysis<LoopInfo> from ModulePass
Hi, I wrote tiny ModulePass which iterates over functions and then uses getAnalysis<LoopInfo> in order to get informations about the loop. It compiles smoothly, but whenever I try to run it I got error like this: opt: .. PassAnalysisSupport.h:203: AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*) const [with AnalysisType = llvm::LoopInfo]: Assertion `ResultP...
2012 Mar 09
2
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
...I am trying to write a new ModulePass using LoopInfo analysis result, but it seems I misunderstand some concept about PassManager. Basically I want to keep LoopInfo analysis result alive. Here is an example showing the problem I encountered, assuming I already addRequired<llvm::LoopInfo>() in getAnalysisUsage: void foo(llvm::Function *F1, llvm::Function *F2) { llvm::LoopInfo *LI1, LI2; LI1 = &getAnalysis<llvm::LoopInfo>(*F1); llvm::Loop* L1 = LI1->getLoopFor(F1->begin()); LI2 = &getAnalysis<llvm::LoopInfo>(*F2); llvm::Loop* L2 = LI2->getLoopFor(F2->begin...
2008 Dec 01
0
[LLVMdev] Error when using getAnalysis
nitisha warkari wrote: > Hi, > > I'm trying to use the function getAnalysis. This is the code I'm using : > > void getAnalysisUsage(AnalysisUsage &AU) const { > AU.addRequired<LoopInfo>(); > AU.setPreservesAll(); > } > > virtual bool runOnModule(Module &M) { > LoopInfo &LI = getAnalysis<LoopInfo>();...
2010 Jul 29
1
[LLVMdev] Controlling the order of a FunctionPass
On Jul 23, 2010, at 7:36 AM, John Criswell wrote: > 2) For prerequisite *analysis* passes (like LoopInfo), your ModulePass > can declare them as prerequisites and get access to them using the > getAnalysis<PassName>(Function *) method. Yes, I remember trying this before but was unsuccessful. I made a second attempt just now and am again running into the same issue: bool MyModulePass::runOnModule(Module &M) { for (Module::iterator i = M.begin(), e = M.end(); i != e; ++i) {...
2010 Sep 15
0
[LLVMdev] getAnalysis<LoopInfo> from ModulePass
hi, On Wed, Sep 15, 2010 at 8:21 PM, Mariusz Grad <mariusz.grad at gmail.com> wrote: > Hi, > > I wrote tiny ModulePass which iterates over functions and then uses getAnalysis<LoopInfo> in order to get informations about the loop. > It compiles smoothly, but whenever I try to run it I got error like this: > opt: .. PassAnalysisSupport.h:203: AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*) const [with AnalysisType = llvm::LoopInfo]: Assertio...
2002 Nov 03
2
[LLVMdev] getAnalysis()
I'm having trouble with using getAnalysis() to access the results of one pass from within another. I require the pass to be previously executed as follows: void MyPass::getAnalysisUsage(AnalysisUsage &Info) const { Info.addRequired<TDDataStructures>(); } Then I try to use it as follows: bool MyPass::doInitialization(M...
2017 Feb 14
2
addRequired() + getAnalysis() for new / non-legacy pass manager
Hi! I am trying to extend the native AliasAnalysis of LLVM to use an external analysis pass. Doing this with the legacy pass manager works fine through calling addRequired() in the getAnalysisUsage and getAnalysis() in function runOnFunction(). In the new pass manager, I haven't found a similar way of doing this. When running opt with -O3, I encounter the following error: >Assertion `ResultPass && "getAnalysis*() called on an analysis that was not " "'r...