Displaying 3 results from an estimated 3 matches for "getv".
Did you mean:
get
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;
}
--------------------------------------------------------
2. Then, I translated it to LLVM...
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 Apr 24
1
[LLVMdev] llvm-g++ doesnt support class member initialization of arrays of constants
Here is the example code:
class A {
const int x[5];
public:
//A() { x[0] = 1; x[1] = 1; x[2] = 2; x[3] = 3; x[4] = 4; }
A():x((const int[5]){1,2,3,4,5}) {}
int getV(int idx) { return x[idx];}
};
//const int A::x[5] = { 1, 2, 3, 4, 5 };
int main() {
A a;
return a.getV(1);
}
gcc 4.1.2 can compile the above code.
llvm-gcc reports:
x.cpp: In constructor \u2018A::A()\u2019:
x.cpp:5: error: array used as initializer
am i missing something?
--------------...