Grigori Fursin wrote:
Well, we need to return values or even structures using plugins for our
MILEPOST project
to tune cost models. A simple example is loop unrolling: in our current plugin
implementation
(MILEPOST GCC/ICI) we register a plugin function that will predict loop unrolling and pass some
code features to it (code size, etc) whenever loop unrolling is performed. Then the plugin
communicates with the predictive model server (implemented in MATLAB) and returns a loop unrolling
factor (as an integer). However, we will need to return more complex structures in case of polyhedral
optimizations in GCC 4.4 (GRAPHITE) or other optimizations/code generation...
So what would you propose we do about return values? Some sort of
pointer, or a code suggesting that the caller look up a variable some
where? Or should we just suggest using void*event_data to pass a struct
with fields to be used as outparams(I like this idea as it means no
changes are needed :)?
Taras