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

Jun Koi junkoi2004 at gmail.com
Wed Aug 22 03:29:47 PDT 2012


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?)

thanks so much!
Jun



More information about the llvm-dev mailing list