Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Getting the trip count of a loop"
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
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:
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
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;
2010 May 07
2
[LLVMdev] getTripCount requires which optimization passes?
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 certain optimization passes to run first, but it's not clear
which ones. There doesn't seem to be any documentation on this. Does
anybody
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:
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 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
2008 Sep 16
2
[LLVMdev] DOTGraphTraits and GraphWriter
Hi Dan,
Thanks for the reply. I got the labels for each outgoing edge (at the
source node's 'structure' field) working. Is there a way to find out
the outgoing edge number from EdgeIter. (Basically the Node in my
graph has a a bunch of outgoing edges, so that I can just index into
that collection within the node to get the appropriate edges'
attributes).
regards,
Prakash
On Tue,
2008 Nov 04
4
[LLVMdev] Debugging lli using bugpoint
Hi Evan,
Thanks for the pointers. We found a simple test case that causes the problem
(thanks to Tom in my group):
#include<stdio.h>
#include<stdlib.h>
void test();
void (*funcPtr)();
int main(int argc, char **argv) {
funcPtr = test;
test();
}
void test() {
if(funcPtr == test) {
printf("OK!\n");
} else {
fprintf(stderr, "Bad!\n");
exit(1);
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>
2008 Nov 02
2
[LLVMdev] Debugging lli using bugpoint
Hi Eli,
Thanks for the reply. I tried with -Xlinker="-ldl ". However it does not
seem to make a difference. It seems that when bugpoint is run with
--run-jit, the linker args are not passed to gcc (from
tools/bugpoint/ExecutionDriver.cpp) :
if (InterpreterSel == RunLLC || InterpreterSel == RunCBE ||
InterpreterSel == CBE_bug || InterpreterSel == LLC_Safe)
RetVal =
2009 Jan 14
2
[LLVMdev] Mapping between LLVM bitcode and C source
Hi,
Is there a way, from within an opt pass, to find the correspondence
between an LLVM IR object and C source code (basically line number
info similar to the one used with gcc + gdb to help debugging ),
assuming either a llvm-gcc front end ?
Sorry if this question was asked before.
Thanks for your time.
- Prakash
2008 Sep 15
2
[LLVMdev] DOTGraphTraits and GraphWriter
Hi all,
I have two questions related to .dot graph output. Basically, I have a
graph representing a program dependence graph like structure with
(a) multiple edges between the same pair of nodes
(b) each edge having a special (different) text/label
I implemented a template-specialized version of DotGraphTraits for the
my graph structure which given a node, uses a map_iterator (similar to
the one
2008 Sep 22
0
[LLVMdev] DOTGraphTraits and GraphWriter
Hi Prakash,
I don't know of an easy way to do this, other than to use random-access
iterators so you can compute the distance between the edge and the
beginning of the list of edges.
Dan
On Sep 16, 2008, at 2:58 PM, Prakash Prabhu wrote:
> Hi Dan,
>
> Thanks for the reply. I got the labels for each outgoing edge (at the
> source node's 'structure' field) working. Is
2009 Jan 16
1
[LLVMdev] poolallocation error
Hi all,
I too am getting this error for x86_64 when I am trying to use the
Data Structure Analysis ...I svn upped both the llvm main branch and
the poolalloc today in the morning and recompiled everything from
scratch :
$ opt -load /home/pprabhu/llvm/llvm-install-x86-64/lib/libpoolalloc.so
-ds-aa < o.bc
opt: /home/pprabhu/llvm/llvm/lib/VMCore/PassManager.cpp:1418: virtual
void
2008 Sep 24
2
[LLVMdev] Memory Altering/Accessing Instructions
Hi all,
Would it be correct to say that the only instructions in LLVM IR that
modify/access memory potentially are the following:
(1) LoadInst : Ref
(2) StoreInst : Mod
(3) VAArgInst : Ref (?)
(4) AllocaInst : Mod
(5) MallocInst : Mod
(6) FreeInst : Mod
(7) CallInst : Mod/Ref ?
Also, my earlier impression was that the GEP instruction only computes
the effective address and does not
2008 Oct 28
2
[LLVMdev] Debugging lli using bugpoint
Hi,
I have a program that runs when statically compiled using llc and gcc but
crashes with a segmentation fault when run with lli. I am trying to debug it
with bugpoint and the initial part of bugpoint seems to be suggesting that I
am somehow missing the linking with the libraries having dlsym/dlopen
although I am passing it to lli :
*$ bugpoint -run-jit
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
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