[Mono-dev] inlining and performance of SIMD code
kumpera at gmail.com
Wed Dec 2 13:43:34 EST 2009
On Tue, Oct 20, 2009 at 2:10 PM, Erven Rohou <erven.rohou at inria.fr> wrote:
> I have a few questions about inlining:
> - I am curious what the heuristics are. I looked at the function
> mono_method_check_inlining, but even when the function returns TRUE, the
> function might not be inlined. Could you point me the relevant piece of
> code? Is
> there any high level rule to make a guess, like complex control flow, use
> certain opcode, etc?
The code in mono_method_check_inlining is just an heristics of what methods
try to inline. The code that decides what gets inlined or not is in
look for INLINE_FAILURE calls.
> - Can I force inlining of a given function? Even a hack is fine, I am
> trying to
> evaluate several code generation schemes, and I would like to measure the
> of inlining. Whatever works is fine.
This has been requested a few times, there is a patch floating on the
that adds the beginning of the code required for such thing. Other than
that, no, there
is not way to force inlining.
As a hack you can simply change the heristics function to check against an
and then make the call to inline_method pass true to the last argument.
> It seems that a simple copy propagation followed by dead code elimination
> fix it. But I am not sure where I should look. Any comment or suggestion?
Generating good code without the simd ops enabled was never the idea, but to
it I fear we would need a scalar replacement pass, which is very tricky.
We could get most of the same benefit by using high level load/store from
instructions and decompose them later. This would enable us to do apply the
optimizations which right now are not enabled since we generate indirect
which disable most optimizations.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list