search for: getloopinfo

Displaying 20 results from an estimated 21 matches for "getloopinfo".

2010 Aug 14
0
[LLVMdev] Questions about trip count
...lude "llvm/Analysis/ScalarEvolution.h" using namespace llvm; STATISTIC(HelloCounter, "Counts number of functions greeted"); namespace { struct Hello: public FunctionPass { static char ID; // Pass identification, replacement for typeid Hello() : FunctionPass(&ID) {} void getLoopInfo(const Function& F) const { const LoopInfo *LI = &getAnalysis<LoopInfo> (); ScalarEvolution *SE = &getAnalysis<ScalarEvolution> (); Function::const_iterator BB = F.begin(), E = F.end(); for (; BB != E; ++BB) { const Loop* L = LI->getLoopFor(&*BB); if (L != NULL) { er...
2010 Aug 12
2
[LLVMdev] Questions about trip count
On 08/12/2010 09:41 PM, Douglas do Couto Teixeira wrote: > Dear guys, > > I am having problems to obtain good information from the LoopInfo. > I am always getting a trip count of 0, even though I am clearly passing > a loop with a constant bound. I am using this pass below: Hi, I would propose to first check if the trip count is calculated correctly. I would do this with opt
2018 Jan 28
0
Polly Dependency Analysis in MyPass
...nd 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<DominatorTreeWrapperPass>().getDomTree();...
2010 Sep 15
2
[LLVMdev] getAnalysis<LoopInfo> from ModulePass
...ule.h> #include "llvm/Support/raw_ostream.h" #include "llvm/ADT/Statistic.h" #include "llvm/Analysis/LoopInfo.h" using namespace llvm; namespace { struct bb_info: public ModulePass { static char ID; bb_info() : ModulePass(&ID) {} void getLoopInfo(const Function& F) const { const LoopInfo *LI = &getAnalysis<LoopInfo> (); Function::const_iterator BB = F.begin(), E = F.end(); for (; BB != E; ++BB) errs() << BB->getName() << " " << LI->getLoopDepth(&*BB)...
2018 Jan 28
4
Polly Dependency Analysis in MyPass
Hello, I need to analyze dependencies in my llvm ir by using polly. i created a new pass called mypass there i added polly dependency analysis pass 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) {
2019 Mar 26
2
On-the-fly passes
...ction &F) -> PostDominatorTree & { return this-> getAnalysis<PostDominatorTreeWrapperPass>(F).getPostDomTree(); }; auto LoopInfoGetter = [this] (Function &F) -> LoopInfo & { return this->getAnalysis<LoopInfoWrapperPass>(F).getLoopInfo(); }; auto SCEVGetter = [this] (Function &F) -> ScalarEvolution & { return this->getAnalysis<ScalarEvolutionWrapperPass>(F).getSE(); }; auto AssumptionCacheGetter = [this] (Function &F) -> AssumptionCache & { return...
2018 Jan 28
1
Polly Dependency Analysis in MyPass
...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<DominatorTreeWrapperPass&...
2018 Feb 07
2
Question about using LoopAccessLegacyAnalysis
...amp;AU) const { AU.addRequired<LoopInfoWrapperPass>(); AU.addRequired<LoopAccessLegacyAnalysis>(); AU.setPreservesAll(); } // processing virtual bool runOnFunction(Function &F) { LoopInfo &li = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); LoopAccessLegacyAnalysis &lala = getAnalysis<LoopAccessLegacyAnalysis>(); for(LoopInfo::iterator lp = li.begin(); lp != li.end(); lp++) { Loop *loop = *lp; const LoopAccessInfo &lai = lala.getInfo(loop); // need h...
2017 Jul 10
2
Problems with registering of ModulePass (with Dependencies)
...onPass() : ModulePass(ID) { } virtual bool runOnModule(Module &M) override { errs() << "In module called: " << M.getName() << "!\n"; LoopInfo& li = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); return false; } virtual void getAnalysisUsage(AnalysisUsage& au) const override { au.setPreservesCFG(); au.addRequired<LoopInfoWrapperPass>(); } }; } char Skele...
2018 Jan 29
1
Polly Dependency Analysis in MyPass
...namespace { struct mypass : public FunctionPass { static char ID; mypass() : FunctionPass(ID) { } virtual bool runOnFunction(Function &F) { std::unique_ptr<ScopInfo> Result; std::unique_ptr<ScopDetection> Result2; auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); auto &RI = getAnalysis<RegionInfoPass>().getRegionInfo(); auto &AA = getAnalysis<AAResultsWrapperPass>().getAAResults(); auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE(); auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();...
2010 Sep 15
0
[LLVMdev] getAnalysis<LoopInfo> from ModulePass
...tream.h" > #include "llvm/ADT/Statistic.h" > #include "llvm/Analysis/LoopInfo.h" > > using namespace llvm; > > namespace { >  struct bb_info: public ModulePass { >    static char ID; > >    bb_info() : ModulePass(&ID) {} > >      void getLoopInfo(const Function& F) const { >        const LoopInfo *LI =  &getAnalysis<LoopInfo> (); you may try &getAnalysis<LoopInfo> (F); please have a look at the declaration of getAnalysis for detail information. best regards ether >        Function::const_iterator BB = F.begi...
2018 Feb 08
0
Question about using LoopAccessLegacyAnalysis
...dRequired<LoopInfoWrapperPass>(); > AU.addRequired<LoopAccessLegacyAnalysis>(); > AU.setPreservesAll(); > } > > // processing > virtual bool runOnFunction(Function &F) { > LoopInfo &li = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); > LoopAccessLegacyAnalysis &lala = getAnalysis< > LoopAccessLegacyAnalysis>(); > > for(LoopInfo::iterator lp = li.begin(); lp != li.end(); lp++) > { > Loop *loop = *lp; > const LoopAccessInfo &lai = lala.getI...
2018 Jan 29
0
Polly Dependency Analysis in MyPass
How do you compile the code? Within the Polly subdirectory using CMake? How do you run your pass. Using "opt -mypass inputfile.ll"? Michael 2018-01-28 9:30 GMT-06:00 hameeza ahmed via llvm-dev <llvm-dev at lists.llvm.org>: > Hello, > > I need to analyze dependencies in my llvm ir by using polly. i created a new > pass called mypass there i added polly dependency
2012 Mar 09
0
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
...g LLVM-3.1-svn version. I would really appreciate your help! The trick I've used is to structure the code so that getAnalysis<>() is only called once per function. For example, your ModulePass can have a std::map that maps between Function * and LoopInfo *. You then provide a method getLoopInfo(Function * F) that checks to see if F is in the map. If it is, it returns what is in the map. If it isn't, it calls getAnalysis on F, stores the result in the map, and returns the LoopInfo pointer. This is important not only for functionality (in your case) but also for performance; you...
2012 Mar 09
2
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
Hello, 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
2019 Jan 31
4
Confusing ERROR with LoopAccessLegacyAnalysis: Pass 'Unnamed pass: implement Pass::getPassName()' is not initialized.
...based on LLVM 9.0.0: ===================================================================== bool LoopInformationCollect::runOnLoop(Loop *L, LPPassManager &) { auto &SE = getAnalysis<ScalarEvolutionWrapperPass>().getSE(); auto &LI = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); // auto *LAA = &getAnalysis<LoopAccessLegacyAnalysis>(); if (Loop_id.find(L)==Loop_id.end()) // traverse instructions in the block assign instruction ID { Loop_id[L] = ++Loop_Counter; } // *Loop_out << "---------------Loop report----------------\n...
2012 Mar 09
3
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
...svn version. I would really appreciate your help! > > The trick I've used is to structure the code so that getAnalysis<>() is only called once per function. For example, your ModulePass can have a std::map that maps between Function * and LoopInfo *. You then provide a method getLoopInfo(Function * F) that checks to see if F is in the map. If it is, it returns what is in the map. If it isn't, it calls getAnalysis on F, stores the result in the map, and returns the LoopInfo pointer. > > This is important not only for functionality (in your case) but also for performance...
2015 Oct 28
2
how to get LoopInfo in FunctionPass in LLVM3.7.0
I want get some loop information(the methods are included in LoopInfo class) ,but when I use "const LoopInfo *LI=&getAnalysis<LoopInfo>()", I got a compiler error. the version of LLVM is 3.7.0. can anyone help me?please give me some example.thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL:
2018 Feb 07
0
Question about using LoopAccessLegacyAnalysis
...) const { AU.addRequired<LoopInfoWrapperPass>(); AU.addRequired<LoopAccessLegacyAnalysis>(); AU.setPreservesAll(); } // processing virtual bool runOnFunction(Function &F) { LoopInfo &li = getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); LoopAccessLegacyAnalysis &lala = getAnalysis<LoopAccessLegacyAnalysis>(); for(LoopInfo::iterator lp = li.begin(); lp != li.end(); lp++) { Loop *loop = *lp; const LoopAccessInfo &lai = lala.getInfo(loop); // n...
2012 Mar 09
0
[LLVMdev] How to keep FunctionPass analysis result alive in Module Pass?
...ciate your help! >> >> The trick I've used is to structure the code so that getAnalysis<>() >> is only called once per function. For example, your ModulePass can >> have a std::map that maps between Function * and LoopInfo *. You >> then provide a method getLoopInfo(Function * F) that checks to see if >> F is in the map. If it is, it returns what is in the map. If it >> isn't, it calls getAnalysis on F, stores the result in the map, and >> returns the LoopInfo pointer. >> >> This is important not only for functionality (i...