similar to: loop induction variables at IR level

Displaying 20 results from an estimated 4000 matches similar to: "loop induction variables at IR level"

2016 Aug 25
3
Canonicalize induction variables
I just subscribed this group. This is my first time to post a question (not sure if this is a right place for discussion) after I have a brief look at LLVM OPT (dev trunk). I would expect loop simplification and induction variable canonicalization pass (IndVarSimplify pass) should be able to convert the following loops into a simple canonical form, i.e., there is a canonical induction variable
2016 Aug 25
4
Canonicalize induction variables
But even for a very simple loop: int test1 (int *x, int *y, int *z, int k) { int sum = 0; for (int i = 10; i < k; i++) { z[i] = x[i] / y[i]; } return sum; } The initial value of induction variable is not zero after compiling with -O3 -mcpu=power8 x.cpp -S -c -emit-llvm -fno-unroll-loops (see bottom of the email for IR) Also I can write somewhat more complicated loop where step
2012 Jul 25
2
[LLVMdev] regarding opt -indvars
Hello . opt -indvars pass does not generate canonical induction variable.  (NULL == loop->getCanonicalInductionVariable();) PLEASE explain why? and how can I fix it? Thanks in advance, Edvard  -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120724/92a28ed5/attachment.html>
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
2017 Jul 25
2
loop canonical variables
Hello, I need to perform the analysis of loop induction variables. However, as I understood, directly it is possible to extract only a canonical induction variable which is only one. If I have multiple induction variables with the step not one, are there any methods to extract their phi node? int a[10]; int b[10]; for (int i = 0, j = 1; i < 10, j < 10; i++, j+=2) {
2011 Jan 19
2
[LLVMdev] induction variable computation not preserving scev
On 19 January 2011 13:01, Dan Gohman <gohman at apple.com> wrote: > > On Jan 18, 2011, at 12:32 AM, Nick Lewycky wrote: > > > Hi, > > > > I tracked down a bug in indvars where we weren't updating SCEV properly. > The attached patch shows the fix to this bug with a testcase, but it also > causes five new test failures. > > Indvars isn't
2011 Jan 20
0
[LLVMdev] induction variable computation not preserving scev
On Jan 19, 2011, at 2:03 PM, Nick Lewycky wrote: > On 19 January 2011 13:01, Dan Gohman <gohman at apple.com> wrote: > > On Jan 18, 2011, at 12:32 AM, Nick Lewycky wrote: > > > Hi, > > > > I tracked down a bug in indvars where we weren't updating SCEV properly. The attached patch shows the fix to this bug with a testcase, but it also causes five new test
2012 Jan 16
2
[LLVMdev] Opt pass 'Canonicalize Induction Variables' not working
I am new to LLVM and I've a question about the optimization passes and in particular about the loop transformation passes. I've setup the LLVM tool-chain with Polly installed. The following example is causing problems with me: http://llvm.org/docs/Passes.html#indvars The input is a .c file with the following loops: # 01 Standard, N=100 for (i=0; i<N; i++) b[i] = a[i] + 5; # 02
2004 Mar 31
2
[LLVMdev] A question about induction variables
Hello, I've just downloaded the latest release of LLVM, and playing with the following simple example: int main() { int r(0); for (int i = 0; i < 100; ++i) r += i; ; return r; } I compile it and then run: analyze -indvars x.bc which prints: Printing analysis 'Induction Variable Analysis' for function 'main': and nothing else. It is a
2012 Jul 24
0
[LLVMdev] regarding opt -indvars
Hello . I ran opt with -indvars options , got wrong result.  This is my example: test.cc :  int test(int a)                 {      for (int i = 2; i < a; ++i) {                            a += ;      }              return a; } clang -O3 -emit-llvm -S test.cc -o test.ll opt -indvards -S test.ll  -o indvars.ll > /dev/null indvars.ll : ; ModuleID = 'test.ll' target datalayout =
2012 Jan 16
0
[LLVMdev] Opt pass 'Canonicalize Induction Variables' not working
On 01/16/2012 01:19 PM, Pieter Custers wrote: > I am new to LLVM and I've a question about the optimization passes and > in particular about the loop transformation passes. I've setup the LLVM > tool-chain with Polly installed. > > The following example is causing problems with me: > http://llvm.org/docs/Passes.html#indvars > > The input is a .c file with the
2017 Apr 17
2
Question on induction variable simplification pass
Hi Pankaj, On April 14, 2017 at 4:55:16 PM, Chawla, Pankaj (pankaj.chawla at intel.com) wrote: > I have attached the IR I got by compiling with -O2. This is just before we widen the IV. Thanks! > To get the backedge taken count info I ran indvars on it and then replaced zext with sext. > > I think regardless of where we decide to add this transformation in the pipeline, it should
2004 Apr 01
1
[LLVMdev] A question about induction variables
Chris Lattner wrote: > > int main() > > { > > int r(0); > > for (int i = 0; i < 100; ++i) > > r += i; > > ; > > return r; > > } > > When I compiled it, I got the following LLVM code: The code I get is somewhat different: int %main() { entry: %tmp.1.i = load bool* %Initialized.0__ ; <bool> [#uses=1] br
2017 Apr 13
3
Question on induction variable simplification pass
Hi all, It looks like the induction variable simplification pass prefers doing a zero-extension to compute the wider trip count of loops when extending the IV. This can sometimes result in loss of information making ScalarEvolution's analysis conservative which can lead to missed performance opportunities. For example, consider this loopnest- int i, j; for(i=0; i< 40; i++) for(j=0;
2016 Oct 16
3
Induction variable identification?
Hi, How does LLVM identify induction variables of a loop? Is the algorithm based on SSA graphs? I have a complicated loop and I need to do some analysis around it. Can anyone please point me to source of identification part? -- *Disclaimer: Views, concerns, thoughts, questions, ideas expressed in this mail are of my own and my employer has no take in it. * Thank You. Madhur D. Amilkanthwar
2004 Mar 31
0
[LLVMdev] A question about induction variables
On Wed, 31 Mar 2004, Vladimir Prus wrote: > I've just downloaded the latest release of LLVM, and playing with the > following simple example: > > int main() > { > int r(0); > for (int i = 0; i < 100; ++i) > r += i; > ; > return r; > } When I compiled it, I got the following LLVM code: int %main() { entry: call void %__main( )
2003 Sep 09
2
[LLVMdev] induction variables
Hello LLVM, Can you suggest a good way to use the loops and induction variable passes to map loop exiting BasicBlocks to InductionVariables. That is, can we use these tools to identify the loop condition. What i have tried Function Pass: foreach BB if(terminal is loop exit of containing loop) trace back to instruction producing the cond that the branch branches on -
2017 Jul 25
2
loop canonical variables
I call this function and it returns only "i" in my example. Are there any ways to return "j" also? 2017-07-25 19:11 GMT+02:00 Michael Kruse <llvmdev at meinersbur.de>: > There is Loop::getCanonicalInductionVariable() > > You may need to run the "-indvars" (IndVarSimplify) pass before it > returns a value. I am not sure it normalizes the step size
2019 Aug 08
3
How to best deal with undesirable Induction Variable Simplification?
Hello, Recently I've come across two instances where Induction Variable Simplification lead to noticable performance regressions. In one case, the removal of extra IV lead to the inability to reschedule instructions in a tight loop to reduce stalls. In that case, there were enough registers to spare, so using extra register for extra induction variable was preferable since it reduced
2012 Jul 24
4
[LLVMdev] loop detection
Hello . I'm trying to implement FunctionPass for detecting loops in llvm IR. How can I get <condition> for loop from llvm::Loop object.? Is there any example? Thanks in advance, Edvard  -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120723/85e7f2f9/attachment.html>