[LLVMdev] Problem migrating from llvm 2.9 to 3.0

Juan Manuel Martinez Caamaño jmartinezcaamao at gmail.com
Wed Nov 7 10:13:15 PST 2012


Hi Duncan,
In in both versions of llvm it unrolls that loop. But I don't understand
why in 2.9 it uses registers for intermediate results and only one store,
and in the other version, it performs stores for every intermediate result.

I've tried compiling on llvm 3.0 using exactly the same optimizations, in
the same order as in 2.9 and I still get the same problem. Maybe a
optimization has changed from 2.9 to 3.0 ?

Thanks,

Juan


2012/11/7 Duncan Sands <baldrick at free.fr>

> Hi Juan,
>
>
> On 07/11/12 13:35, Juan Manuel Martinez Caamaño wrote:
>
>> Hello, I'm moving a compiler pass from llvm 2.9 to 3.0, and I'm getting
>> some
>> strange extra store instructions when optimizing the code.
>>
>> For example, in the code that is in the attachments (On block
>> *for.body111* for
>> 2.9 and block *for.body67 *for 3.0), the number of stores goes from 1 to
>> 10. And
>>
>> since the compiler pass adds some verification code before each store,
>> this
>> leads to some performance problems.
>>
>> The resulting .ll is obtained in this way:
>> clang -O3 fir2dim.c -S -emit-llvm -o fir2dim.ll
>> llvm-as fir2dim.ll
>> opt -O3 fir2dim.bc > fir2dim.opt.bc
>> llvm-dis fir2dim.opt.bc
>>
>> Any idea why this is happening ?
>>
>
> maybe it completely unrolled this loop:
>
>
>                                 for (i = 0 ; i < 9 ; i++) {
>                                         *poutput += *pcoeff++ * *(parray++
> +(i / 3) * ARRAYDIM) ;
>                                 }
>
> ?
>
> Ciao, Duncan.
> ______________________________**_________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121107/1fd8408f/attachment.html>


More information about the llvm-dev mailing list