similar to: [LLVMdev] Running both Function and Loop passes together

Displaying 20 results from an estimated 4000 matches similar to: "[LLVMdev] Running both Function and Loop passes together"

2011 May 21
4
[LLVMdev] getCanonicalInductionVariable
Hi I have the followed code for which I am writing a loop pass. int main() { int i = 0; for (i=0; i<20; i++) { printf ("hello world %d\n", i); } return 0; } In the function runOnLoop, I have the following instruction PHINode *indv = NULL; indv = L->getCanonicalInductionVariable(); However, when I check indv is always set to NULL. Since the code has a canonical
2011 May 22
0
[LLVMdev] getCanonicalInductionVariable
Hi, What does your LLVM IR look like. Are you sure the loop hasnt been optimized away? Arushi On Sat, May 21, 2011 at 5:52 PM, Malveeka Tewari <mtewari at eng.ucsd.edu>wrote: > Hi > > I have the followed code for which I am writing a loop pass. > > int main() { > int i = 0; > for (i=0; i<20; i++) { > printf ("hello world %d\n", i); > }
2011 May 23
0
[LLVMdev] Fwd: getCanonicalInductionVariable
Forwarding to list :) ~Will ---------- Forwarded message ---------- From: Malveeka Tewari <mtewari at eng.ucsd.edu> Date: Sun, May 22, 2011 at 12:38 AM Subject: Re: [LLVMdev] getCanonicalInductionVariable To: willdtz at gmail.com Adding -mem2reg fixed the problem ! Thanks a lot! Malveeka On Sat, May 21, 2011 at 9:47 PM, Will Dietz <willdtz at gmail.com> wrote: > > Also, make
2011 May 05
0
[LLVMdev] Loop transformations using LLVM
Malveeka, You can use the LoopInfo analysis to find the induction variable. http://llvm.org/docs/doxygen/html/classllvm_1_1Loop.html#a72bbf45d2e00971f56bf8cfe4e1df01c Cheers, Nadav From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Malveeka Tewari Sent: Thursday, May 05, 2011 14:51 To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] Loop transformations
2011 May 07
1
[LLVMdev] Loop transformations using LLVM
On May 5, 2011, at 5:11 AM, Rotem, Nadav wrote: > Malveeka, > > You can use the LoopInfo analysis to find the induction variable. > > http://llvm.org/docs/doxygen/html/classllvm_1_1Loop.html#a72bbf45d2e00971f56bf8cfe4e1df01c > > Cheers, > Nadav getCanonicalInductionVariable is a good example of finding IVs without iterating over instructions. But you may need to
2011 May 05
2
[LLVMdev] Loop transformations using LLVM
Hi I am trying to write up a transformation for the following code where instead of incrementing the loop variable by 1, I increment it by 2 ie. for (i=0; i < THRES; *i++*) { //do something } gets transformed to for (i=0; i < THRES; *i+=2*) { //do something } I am thinking of transforming the llvm bit-code in the following way. Iterate over the function for the original code till I
2011 Jun 04
2
[LLVMdev] Function name changes in .bc on running llvm-g++
Hi I am running llvm-g++ on a .cpp file to generate the llvm bitcode. The function definition in the .cpp file is: float pFL(Points *points, int *feasible, int numfeasible, float z, long *k, double cost, long iter, float e, int pid, pthread_barrier_t* barrier) { However, in the bit code I see that the function name has been modified to the following define float
2011 Jun 04
0
[LLVMdev] Function name changes in .bc on running llvm-g++
On 6/3/11 9:55 PM, Malveeka Tewari wrote: > Hi > > I am running llvm-g++ on a .cpp file to generate the llvm bitcode. > > The function definition in the .cpp file is: > > float pFL(Points *points, int *feasible, int numfeasible, float z, long *k, > double cost, long iter, float e, int pid, pthread_barrier_t* > barrier) { > > However, in the bit code I see
2005 Jul 28
2
[LLVMdev] help with pointer-to-array conversion
I now understand that IndVarSimplify.cpp is capable of reproducing array references when the pointer initialization from the array address is found inside the immediately enclosing loop, such that in the following code: int A[20000], B[100], Z; int main() { int i, j, *a, *b; for ( a = &A[0], i = 0; i != 200; i++ ) for ( b = &B[0], j = 0; j != 100; j++
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 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 =
2005 Jul 28
0
[LLVMdev] help with pointer-to-array conversion
On Thu, 28 Jul 2005, Naftali Schwartz wrote: > I now understand that IndVarSimplify.cpp is capable of reproducing array > references when the pointer initialization from the array address is found > inside the immediately enclosing loop, such that in the following code: Ok. > int A[20000], B[100], Z; > int main() > { > int i, j, *a, *b; > for ( a =
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
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,
2008 Aug 19
1
[LLVMdev] LoopPass Question
On Tuesday 19 August 2008 15:15, Devang Patel wrote: > On Aug 19, 2008, at 12:32 PM, David Greene wrote: > > Are LoopPasses allowed to maintain state between runOnLoop > > invocations? > > What kind of information are you looking to maintain between runOnLoop > invocations ? Cached analysis answers. > > The documentation is not clear on this point. > >
2010 Mar 26
0
[LLVMdev] [PATCH] Before/After IR Dumps
On Mar 17, 2010, at 11:25 AM, David Greene wrote: > On Monday 15 March 2010 13:45:14 David Greene wrote: >> On Sunday 14 March 2010 18:32:35 Chris Lattner wrote: >>> This is much better than the first iteration but still has many issues. > > I believe I've addressed all your points with this patch except I didn't use > StringRef. It doesn't appear to be
2008 Aug 19
0
[LLVMdev] LoopPass Question
On Aug 19, 2008, at 12:32 PM, David Greene wrote: > Are LoopPasses allowed to maintain state between runOnLoop > invocations? What kind of information are you looking to maintain between runOnLoop invocations ? > > The documentation is not clear on this point. doInitialization() and doFinalization() will be run for each pass before and after runOnLoop(). For each pass
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.
2011 Jan 06
2
[LLVMdev] Identify Loops from within FunctionPass, or possible to intermix different types of Passes?
LLVMers, I have a traversal plan which needs to visit certain types of Functions. For each instruction in such functions, I will need to know: 1. is it located inside a loop 2. if yes, what level of loop nest it is currently in. So on the highest level, it should be a FunctionPass. However, in order to identify loops and loop-nest levels, it should also be a LoopPass. Is there a reasonably
2011 Dec 12
0
[LLVMdev] problem with runOnLoop
On 12/12/11 9:59 AM, neda 8664 wrote: > hi all, > > I want access to all basic blocks of function in a loop, so I used the > following code: > > /bool parallel::runOnLoop(Loop *L, LPPassManager &LPM) > { > for (Function::iterator bi= func->begin(); bi != func->end(); bi++){ > // > } > }/ Are you modifying anything within this code