[LLVMdev] Problem migrating from llvm 2.9 to 3.0

Duncan Sands baldrick at free.fr
Wed Nov 7 08:15:11 PST 2012


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.



More information about the llvm-dev mailing list