Displaying 20 results from an estimated 7000 matches similar to: "[LLVMdev] getTripCount requires which optimization passes?"
2010 May 07
0
[LLVMdev] getTripCount requires which optimization passes?
hi,
On Fri, May 7, 2010 at 8:59 AM, Trevor Harmon <Trevor.W.Harmon at nasa.gov>wrote:
> Hi,
>
> For me, getTripCount always returns null, even for trivial loops such
> as:
>
> void simple(int j) {
> for (int i = 0; i < 10; i++) {
> j++;
> }
> }
>
> Looking through the mailing list archive, it appears that getTripCount
> requires
2010 May 07
2
[LLVMdev] getTripCount requires which optimization passes?
On May 6, 2010, at 6:32 PM, ether zhhb wrote:
> As the comment said:
> /// The IndVarSimplify pass transforms loops to have a form that
> this
> /// function easily understands.
>
> you could try -indvars.
After adding -indvars to the opt command, getTripCount still returns
null.
I suppose it's possible, depending on the scheduling of the pass
manager, that
2010 May 10
0
[LLVMdev] getTripCount requires which optimization passes?
On May 7, 2010, at 11:17 AM, Trevor Harmon wrote:
> On May 6, 2010, at 6:32 PM, ether zhhb wrote:
>
>> As the comment said:
>> /// The IndVarSimplify pass transforms loops to have a form that
>> this
>> /// function easily understands.
>>
>> you could try -indvars.
>
> After adding -indvars to the opt command, getTripCount still returns
2010 May 10
1
[LLVMdev] getTripCount requires which optimization passes?
On May 10, 2010, at 11:45 AM, Dan Gohman wrote:
> just make your front-ends add -indvars before
> adding your pass.
Sorry, I don't have a clue how to do this, and I can't find any docs
about it. I'm using llvm-gcc; how can I tell it to add a pass?
Trevor
2009 Mar 08
1
[LLVMdev] getTripCount()
Hello,
I'm writing a new function pass, and I'm having trouble with
getTripCount() in Loop. If I generate the bitcode for the test code
with no optimization then getTripCount() returns NULL, but if I pass -
O3 to the front-end then getTripCount() returns fine. My phase calls
addRequiredID(LoopSimplifyID) from getAnalysisUsage() and I also tried
putting -mem2reg at the front
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++
2008 Apr 26
2
[LLVMdev] Getting the trip count of a loop
Hi,
I am trying to add a new loop pass in which I making a call to get the trip
count of the loop using
Value *TripCountValue = L->getTripCount()
However I am always getting NULL for TripCountValue (confirmed through gdb).
I am running this pass after the canonicalization of induction variables:
opt --debug-pass=Structure -stats -indvars -loop-rotate -my-loop-pass <
main.bc >
2008 Sep 30
1
[LLVMdev] LoopInfo getTripCount modification proposal
Hi,
I am trying to modify a loop by reducing the loop trip count from N to N-1
where N may be constant. I looked into using getTripCount[1] but discovered
that this method returns a Value* which is N itself. This prevents me from
using this method for changing the loop. I suggest creating another method
for returning the 'cmp' instruction. The new getTripCount implementation
will use the
2010 Apr 06
2
[LLVMdev] Get the loop trip count variable
Thanks a lot for your guys' help!!!
I guess once I am able to get *V* (which probably is a pointer to a
Value object), then, I can instrument some code at the IR level to
dump V. As long as I maintain V at this pass stage, I should be able
to dump the loop trip count. This is true, isn't it?
Basically, what I am going to do is to add a function call before the
loop body, such as:
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 =
2008 Apr 26
0
[LLVMdev] Getting the trip count of a loop
Prakash Prabhu wrote:
> I am trying to add a new loop pass in which I making a call to get the
> trip count of the loop using
>
> Value *TripCountValue = L->getTripCount()
That should work.
Could you file a bug and attach the bytecode after 'opt -indvars
-loop-rotate'? I would need that to determine why LoopInfo::getTripCount
isn't returning any value.
Nick
2012 Jul 02
2
[LLVMdev] Alternative of Loop::getTripCount?
I found out that Loop::getTripCount method is obsolete in LLVM 3.1
Is there an alternative?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120702/ea6ca4e6/attachment.html>
2010 Apr 06
0
[LLVMdev] Get the loop trip count variable
Sorry, I could not the the loop trip count with getTripCount(). I used
a simple program as a test case:
------------------------------------------------------
#include <stdio.h>
int getV(int i)
{
return i * 2;
}
int main()
{
int num = 10;
int sum=0;
int i;
for (i=0; i<num; i++)
{
sum += getV(i);
}
return 0;
2009 Mar 20
1
[LLVMdev] getTripCount and pointers
Hello,
I'm having some trouble with getTripCount() ... again. In particular
it fails in the first of the following two examples, although it works
for the second. By fails, I mean it returns NULL.
---------- example 1 ----------
test1(int *a, const int *ip) {
int k;
for (k = 0; k < ip[2]; ++k) {
a[k] = (k+11)/(k+2);
}
}
---------- example 2 ----------
test2(int
2012 Jul 03
0
[LLVMdev] Alternative of Loop::getTripCount?
Hi Taemin,
On 03/07/2012 01:53, Taemin Kim wrote:
> I found out that Loop::getTripCount method is obsolete in LLVM 3.1
> Is there an alternative?
I use getSmallConstantTripCount() to get loop trip counts using the
ScalarEvolution analysis pass. See
include/llvm/Analysis/ScalarEvolution.h for a detailed explanation.
Ivan
>
>
> _______________________________________________
2008 Dec 09
1
[LLVMdev] scalar-evolution + indvars fail to get the loop trip count?
Hi,
Seems pass scalar-evolution+indvars fail to get the loop trip count of the
following case:
int foo(int x, int y, int lam[256], int alp[256]) {
int i;
int z = y;
for (i = 255; i >= 0; i--) {
z += x;
lam[i] = alp[i];
}
return z;
}
The final optimized ll code is :
define i32 @foo(i32 %x, i32 %y, i32* %lam, i32* %alp) nounwind {
entry:
br label %bb
bb:
2016 May 19
4
GEP index canonicalization
Hi,
InstCombine canonicalizes index operands (unless they are into struct
types) to pointer size. The comment says: "If we are using a wider
index than needed for this platform, shrink it to what we need. If
narrower, sign-extend it to what we need. This explicit cast can make
subsequent optimizations more obvious.".
For our architecture, the canonicalization is a bit
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
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
2010 Mar 01
2
[LLVMdev] Aborting a pass
Hi,
What's the proper way to abort a pass if something goes wrong (e.g.,
in the pass's constructor)? Do I simply call abort()? I looked through
the existing passes but didn't see an example of this. Thanks,
Trevor