[LLVMdev] Optimization of array access

Cameron Zwarich zwarich at apple.com
Mon Nov 21 12:17:21 PST 2011


Where does the -time-passes option say the time is going?

Sent from my iPhone

On Nov 21, 2011, at 8:58 AM, Michael Smith <Michael.Smith at synopsys.com> wrote:

> I’ve attached a 2 examples of patterns for updating an array. They’re simplified examples of some code generation I’m doing where I need to pass a large, unknown number of arguments (ints, doubles, pointers to other information) to a function.
>  
> The two patterns are:
>                 Stack[0] = 0;
>                 Stack[1] = 1;
>                 Stack[2] = 42;
> And
>                 Int I = 0;
>                 Stack[i++] = 0;
>                 Stack[i++] = 1;
>                 Stack[i++] = 42;
>  
> I’ve found that the optimizer is much faster at handling the 2nd pattern than the 1st. With 3000 assignments - as in the examples attached – “opt –std-compile-opts –S func1.ll –o func1.opt” takes 10 seconds, while func2.ll takes 0.2s. Anyone have any ideas why?
>  
> I’ve tested with LLVM 2.9, and LLVM 3.0 RC1.
>  
> Regards,
> Michael
> <opt.zip>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111121/7bfac643/attachment.html>


More information about the llvm-dev mailing list