Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] A question about induction variables"
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( )
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
2005 Feb 22
5
[LLVMdev] Area for improvement
I noticed that fourinarow is one of the programs in which LLVM is much
slower than GCC, so I decided to take a look and see why that is so.
The program has many loops that look like this:
#define ROWS 6
#define COLS 7
void init_board(char b[COLS][ROWS+1])
{
int i,j;
for (i=0;i<COLS;i++)
for (j=0;j<ROWS;j++)
b[i][j]='.';
2005 Feb 22
0
[LLVMdev] Area for improvement
On Mon, 21 Feb 2005, Jeff Cohen wrote:
> I noticed that fourinarow is one of the programs in which LLVM is much slower
> than GCC, so I decided to take a look and see why that is so. The program
> has many loops that look like this:
>
> #define ROWS 6
> #define COLS 7
>
> void init_board(char b[COLS][ROWS+1])
> {
> int i,j;
>
> for
2005 Feb 22
2
[LLVMdev] Area for improvement
Sorry, I thought I was running selection dag isel but I screwed up when
trying out the really big array. You're right, it does clean it up
except for the multiplication.
So LoopStrengthReduce is not ready for prime time and doesn't actually
get used?
I might consider whipping it into shape. Does it still have to handle
getelementptr in its full generality?
Chris Lattner wrote:
2005 Jul 29
1
[LLVMdev] help with pointer-to-array conversion
OK, thanks Chris, I've found that running
opt -loopsimplify -instcombine -indvars -stats
gives me the setup I need for this transformation, and a small patch
makes it happen in the simple case we discussed. However, I'm having
some trouble when things get a bit more complicated with 3 nesting levels:
int A[3000000], B[20000], C[100], Z;
int main()
{
int i, j, k, *a, *b,
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
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
2017 Jul 25
2
loop canonical variables
Hi Anastasiya,
If it fits you use case, you can consider walking the loop header and
calling getSCEV() on all of the PHI nodes in the header. This will
give you a SCEV* which should be easier to analyze than manually
inspecting PHI cycles.
Thanks!
-- Sanjoy
On Tue, Jul 25, 2017 at 11:42 AM, Michael Kruse via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> 2017-07-25 19:32 GMT+02:00
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>
2015 Jul 16
4
[LLVMdev] Improving loop vectorizer support for loops with a volatile iteration variable
----- Original Message -----
> From: "Hal Finkel" <hfinkel at anl.gov>
> To: "Chandler Carruth" <chandlerc at google.com>
> Cc: llvmdev at cs.uiuc.edu
> Sent: Thursday, July 16, 2015 1:58:02 AM
> Subject: Re: [LLVMdev] Improving loop vectorizer support for loops
> with a volatile iteration variable
> ----- Original Message -----
> >
2004 Dec 04
1
[LLVMdev] Question about writing a pass
Hi ,
I got a few for writing a pass.
1) Is it possible to use input parameters in command line ?
For example, we got our own pass, ie. HELLO
opt -load ../../Debug/lib/libHELLO.so -HELLO < hello.bc
From the above command line, could we use some input parameter and we can read those parameter in Pass routine?
2) For splitting BB, the way what I did is to pick up instruction
2003 Sep 08
1
[LLVMdev] Induction Variables
LLVM,
What is the status of the InductionVariable "semi-pass"? I have tested
it out on spec benchmarks, and while it does correctly identify some of
the variables, it fails to recognize most. Typically the following
scenario arises
a_loop:
...
%tmp.19 = load int* %bsLive
%tmp.20 = add int %tmp.19, -8
store int %tmp.20, int* %bsLive
%tmp.5 = setgt int %tmp.20, 0
br bool %tmp.5, label
2015 Aug 13
2
[LLVMdev] Improving loop vectorizer support for loops with a volatile iteration variable
Hi Gerolf,
I think we have several (perhaps separable) issues here:
1. Do we have a canonical form for loops, preserved through the optimizer, that allows naturally-constructed loop nests to remain separable?
2. Do we forbid non-lowering transformations that turn vectorizable loops into non-vectorizable loops?
3. How do we detect cases where transformations cause a negative answer to either
2006 Jun 15
2
[LLVMdev] problem with loopinfo
I did run the indvars pass, but it seemed that it didn't work.
-Wei
----- Original Message -----
From: "Chris Lattner" <sabre at nondot.org>
To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
Sent: Thursday, June 15, 2006 3:35 PM
Subject: Re: [LLVMdev] problem with loopinfo
> On Thu, 15 Jun 2006, Wei Jiang wrote:
>> hi,
>> The
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 -
2006 Jun 15
2
[LLVMdev] problem with loopinfo
hi,
The loopinfo pass failed to recognize the Tripcount of a simple program constructed by me, can you help me to figure out why this happened? Thanks.
The C program and corresponding .ll files are shown below. I used llvm1.7 to develop my own pass, and want to use the loop information.
-Wei
Test.c:
#include "stdio.h"
#define N 40
void func1() {
int a[N];
int i,j;
for
2017 Jul 01
2
loop induction variables at IR level
Hi,
I was looking at trying to get loop induction variable at IR level. LLVM
documentation mentioned indvars pass and getCanonicalInductionVariable() to
get them, I tried running the indvars pass and then a custom pass which
iterates through loops and uses the function to obtain variable for a
simple loop program. But the API returns null. I also read in similar posts
that the indvars pass is not
2017 Aug 09
4
ind variable
This support was removed years ago from indvars. We don't need canonical
induction variables any more as all analysis are done on SCEVs. The SCEV
generator can transform them even without the need for explicit
canonical induction variables.
Best,
Tobias
On Wed, Aug 9, 2017, at 14:23, Anastasiya Ruzhanskaya via llvm-dev
wrote:
> The files of this strange pass are described here
>
2015 Jul 16
2
[LLVMdev] Improving loop vectorizer support for loops with a volatile iteration variable
----- Original Message -----
> From: "Chandler Carruth" <chandlerc at google.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Hyojin Sung" <hsung at us.ibm.com>, llvmdev at cs.uiuc.edu
> Sent: Thursday, July 16, 2015 1:06:03 AM
> Subject: Re: [LLVMdev] Improving loop vectorizer support for loops
> with a volatile iteration