[Vm-dev] [Cog] Strange inliner behavior
Stefan Marr
squeak at stefan-marr.de
Sun Jul 31 10:59:21 UTC 2011
Hi Igor:
On 31/07/11 05:49, Igor Stasenko wrote:
>
> Here the slang code:
>
> size := self sizeBitsOf: op1.
> size = (self sizeBitsOf: op2) ifFalse: [
> ^ false ].
>
> And here translated code:
>
> /* begin sizeBitsOf: */
> header = longAt(op1);
> size = ((header& TypeMask) == HeaderTypeSizeAndClass
> ? (longAt(op1 - (BytesPerWord * 2)))& LongSizeMask
> : header& SizeMask);
> if (!(size == (sizeBitsOf(op2)))) {
> return 0;
> }
>
> as you can see it inlining first, but refuses to inline second one.
Just out of curiosity, in which kind of use cases is the inline-behavior
of the used C compiler not sufficient to rely on, instead of manually
inline such C code?
Especially, since people like Mike Pall of the LuaJIT2 claim that GCC
with -O3 inlines to aggressively anyway which leads to code bloat that
does not fit into typical CPU instruction caches and thus slows things down.
But since that is just 3rd-hand knowledge, I would like to hear about
real experiences.
Best regards
Stefan
>
>
More information about the Vm-dev
mailing list