similar to: [LLVMdev] how to use LoopInfo outside of LLVM

Displaying 20 results from an estimated 3000 matches similar to: "[LLVMdev] how to use LoopInfo outside of LLVM"

2005 Jun 25
0
[LLVMdev] how to use LoopInfo outside of LLVM
Hi, My project is outside of LLVM. Now I need get LoopInfo for a function. I know that if my project were a pass inside LLVM. I can get LoopInfo by "AU.addRequired<LoopInfo>()" and "getAnalysis<LoopInfo>()". Also I know I can get a function pass by "llvm::FunctionPass* dce = llvm::createDeadCodeEliminationPass(); dce->runOnFunction(*func)" outside of
2011 Mar 03
0
[LLVMdev] how can I have LoopInfo in a module pass?
On 3/3/11 3:09 PM, Wenbin Zhang wrote: > Hi all, > I tried to have a LoopInfo object in a function pass, add > addRequired<LoopInfo> in getAnalysisUsage, and then use > getAnalysis<LoopInfo> in runOnFunction(). It worked OK. > Now I want to have a module pass to traverse the functions, and > similarly I want to have to loop information of the functions. When I >
2011 Mar 03
0
[LLVMdev] how can I have LoopInfo in a module pass?
I think this assertion failure may be caused by the getAnalysisUsage(). Mine is like the following: class myclass : public ModulePass{ ... virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<LoopInfo>(); } ... } Is it enough? Thanks! Best, --Wenbin ----- Original Message ----- From: Wenbin Zhang To: John Criswell Cc: llvmdev at
2011 Feb 28
0
[LLVMdev] LoopInfo of a basic block
Thanks Devang and John. My pass is actually a loop pass, not a function pass. So, I couldnt override the getAnalysisUsage. I am in a loop pass, I know the outermost loop. Now How can I get the loopInfo from here? I couldn't find helpful methods in the LoopInfo class documents. On Mon, Feb 28, 2011 at 5:52 PM, John Criswell <criswell at illinois.edu>wrote: > On 2/28/11 4:43 PM,
2011 Feb 28
2
[LLVMdev] LoopInfo of a basic block
On 2/28/11 4:43 PM, Devang Patel wrote: > > On Feb 28, 2011, at 2:35 PM, Naznin Fauzia wrote: > >> Hi all, >> >> How Can I get the Loops around an Instruction? >> >> I know I can get the basic block of an instruction using >> inst.getParent() which returns a BasicBlock*. Now I want to use the >> getLoopFor(BasicBlock) method of the class
2011 Mar 03
2
[LLVMdev] how can I have LoopInfo in a module pass?
Thanks John, I modify my code to like this: bool XXX::ModulePass(Module &M){ .... LoopInfo &li = getAnalysis<LoopInfo>(fi); .... } Here fi is a Function* pointing to main(). Now when I run the pass, another error shows up: AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*, llvm::Function&) [with AnalysisType = llvm::LoopInfo]: Assertion `ResultPass
2011 Feb 28
1
[LLVMdev] LoopInfo of a basic block
On Mon, Feb 28, 2011 at 6:04 PM, Naznin Fauzia <laboni14 at gmail.com> wrote: > Thanks Devang and John. My pass is actually a loop pass, not a function > pass. So, I couldnt override the getAnalysisUsage. > A LoopPass is no different from a FunctionPass here. You can use getAnalysisUsage and getAnalysis in a LoopPass. > I am in a loop pass, I know the outermost loop. Now How
2011 Feb 28
0
[LLVMdev] LoopInfo of a basic block
On Feb 28, 2011, at 2:35 PM, Naznin Fauzia wrote: > Hi all, > > How Can I get the Loops around an Instruction? > > I know I can get the basic block of an instruction using inst.getParent() which returns a BasicBlock*. Now I want to use the getLoopFor(BasicBlock) method of the class LoopInfo. > But I dont know how to get the LoopInfo. > > BasicBlock* bb =
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 `ResultPass &&
2019 Apr 02
2
How can I use llvm::LoopInfo in the runOnModule method?
Hi all, I tried to have a LoopInfo object in a function pass, and add addRequired in getAnalysisUsage, and then use getAnalysis in runOnFunction(). It worked OK. Now I want to have a module pass to traverse the functions, and similarly, I want to have to loop information of the functions. When I did the above in runOnModule, and build the module pass, the following error popped out, and the
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:
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&
2011 Mar 03
2
[LLVMdev] how can I have LoopInfo in a module pass?
Hi all, I tried to have a LoopInfo object in a function pass, add addRequired<LoopInfo> in getAnalysisUsage, and then use getAnalysis<LoopInfo> in runOnFunction(). It worked OK. Now I want to have a module pass to traverse the functions, and similarly I want to have to loop information of the functions. When I did the above in runOnModule, and run the pass, the following error popped
2019 Apr 03
3
How can I use llvm::LoopInfo in the runOnModule method?
Interesting that we're getting a relative flood of these recently. See here: http://lists.llvm.org/pipermail/llvm-dev/2019-March/131346.html I don't think one can reliably get a Function analysis pass from within a ModulePass using the legacy pass manager. You have to manually construct the pass yourself. -David Jonathan Smith via llvm-dev <llvm-dev at
2011 Nov 10
0
[LLVMdev] Problem getting LoopInfo inside non-LoopPass
1. Ok will do. 2. Ok, will do. 3. It's a CallGraphPass. I mentioned this in my first post. 4. Yep, I have the header files included, I'm not sure it would compile otherwise (previously). I would get an error like LoopInfo not declared. I'll try your suggestions, thanks again! On Thu, Nov 10, 2011 at 9:57 AM, John Criswell <criswell at illinois.edu>wrote: > On 11/10/11
2011 Apr 30
2
[LLVMdev] LoopInfo are not able to identify some natural loops?
Hi, I found that some loops can not be identified by LoopInfo pass. For example, the loop at line 3094 of rdopt.c of benchmark 464.h264ref from spec cpu2006 is not a loop or a child (pr grandchild) of any loop in the loop list generated by LoopInfo pass. The documentation of LoopInfo says that it identifies natural loops, who have exactly one entry point. But the IR of this loops shows that
2008 May 05
1
[LLVMdev] LoopInfo::isAnalysis() unused?
Hi, I was looking at the LoopInfo Analysis pass as an example, and found it defined the isAnalysis() method to return true. I assumed the method was overriden from some superclass (Pass, probably) and present in all analysis passes. However, a better look turns out that the method isn't really used anywhere. PassInfo does define the same method which is used, but PassInfo is not a superclass
2012 Oct 03
0
[LLVMdev] LoopInfo analysis in CallGraphSCCPass
On Wed, Oct 3, 2012 at 2:33 AM, vinay m <mvinay05041990 at gmail.com> wrote: > Hi, > Is it possible to recreate the LoopInfo analysis in my pass? > No. You need your pass to be a FunctionPass in order to use the LoopInfo (and associated) analyses. > > Thanks , > Vinay > > On Wed, Oct 3, 2012 at 2:34 PM, Chandler Carruth <chandlerc at google.com>wrote:
2011 Nov 30
0
[LLVMdev] Fwd: Problem getting LoopInfo inside non-LoopPass
The following code is causing an "UNREACHABLE executed!" and a stack dump, any ideas? namespace { struct myPass : public CallGraphSCCPass { static char ID; myPass() : CallGraphSCCPass(ID) {} virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired<LoopInfo>(); } virtual bool runOnSCC(CallGraphSCC &SCC)
2011 Feb 28
2
[LLVMdev] LoopInfo of a basic block
Hi all, How Can I get the Loops around an Instruction? I know I can get the basic block of an instruction using inst.getParent() which returns a BasicBlock*. Now I want to use the getLoopFor(BasicBlock) method of the class LoopInfo. But I dont know how to get the LoopInfo. BasicBlock* bb = inst.getParent(); (... what should I add here?) Loop* innerloop = LI -> getLoopFor(bb): Thanks.