Displaying 2 results from an estimated 2 matches for "testlicm".
Did you mean:
testlib
2010 Aug 15
2
[LLVMdev] a LICM bug (in LLVM-2.7)?
I am studying the Transform/Scalar/LICM.cpp pass, and wrote a simple
test program to validate.
void testLICM(void){
int i,N=100;
int data;
for(i=0;i<N;i++){
data = 1;
printf("i: %d\n",i);
}
printf("data: %d\n", data);
}
I expect the "data=1" will be moved out of loop (either hoist or sink).
However, to my surprise, that statement remains within t...
2010 Aug 15
0
[LLVMdev] a LICM bug (in LLVM-2.7)?
...ocas -- these are
usually handled by mem2reg which happens much earlier (if you run your
example with -mem2reg you'll see it already deleted the store). In
fact, licm sinks the stores by converting them to stores to allocas
first and running mem2reg on that.
If you change your example to
void testLICM(int* restrict p)
{
int i,N=100;
for(i=0;i<N;i++){
*p = 1;
printf("i: %d\n",i);
}
printf("data: %d\n", *p);
}
and run opt with -mem2reg -loop-rotate -licm you can see the store being sunk.
Eugene
On Sun, Aug 15, 2010 at 3:47 AM, Chuck Zhao <czhao at eecg....