[LLVMdev] question on optimizations: when to stop??

Jun Koi junkoi2004 at gmail.com
Fri Aug 24 17:33:01 PDT 2012


On Wed, Aug 22, 2012 at 6:29 PM, Jun Koi <junkoi2004 at gmail.com> wrote:
> hi,
>
> i have some LLVM bitcode, and trying to write a simple LLVM-based code
> to optimize them. i simply apply some selected passes from
> http://llvm.org/docs/Passes.html
>
> if i run the these optimizes once on the input LLVM bitcode, the
> output bitcode is optimized.
> but to my surprise, if i run the optimizes once more, the output
> bitcode is further optimized.
>
> so i have few questions:
>
> 1. why running optimizes once is not enough? they are not smart enough
> to figure out that they should repeat the optimizes once more, until
> no optimized can be done anymore?
>
> 2. in case that optimizes must be repeated in multiple rounds, how can
> i know when is the time to stop? (ie when i dont need to run the
> output bitcode thru the optimizes anymore?)
>
any help, please?

thanks!
Jun



More information about the llvm-dev mailing list