Hi!
I totally agree with Basille. Actually pretty similar thing was
implemented by Liang Peng (ICT) as GCC GSoC'09 project -
http://ctuning.org/wiki/index.php/CTools:ICI:Projects:GSOC09:Function_cloning_and_program_instrumentation
So, probably you should take a look at the code in the
instrument
> Therefore, the most effective way to address the issue of running redundant
> optimization passes in the context is probably to put it in the wider
> context
> of the work to allow external plugins to influence the pass sequence that is
> being applied, and to control this with machine learning.