Yes to both questions.

This is probably a case of something in LLVM where the LLVM optimizer can't
access it, and so it relies on optimizations at later stages, where the
asm.js backend does its own thing. So this is something we should be
optimizing in the asm.js optimizer, but somehow aren't.

If you don't intend to take a look at this yourself, I'd like to, a small
testcase showing the issue would be great.

On Thu, Aug 18, 2016 at 11:31 AM, Charles Vaughn <[email protected]> wrote:

> Interesting code generated I found while investigating some size
> optimizations:
>
> function ila(a,b){a=a|0;b=b|0;mha(a,b+88|0);return}
> function jla(a,b){a=a|0;b=b|0;mha(a,b+-4+88|0);return}
> function kla(a,b){a=a|0;b=b|0;mha(a,b+-12+88|0);return}
>
> From the context, these are different levels of vtable indirection (the
> last 2 are non virtual thunks). Is this:
>
> function ila(a,b){a=a|0;b=b|0;mha(a,b+88|0);return}
> function jla(a,b){a=a|0;b=b|0;mha(a,b+84|0);return}
> function kla(a,b){a=a|0;b=b|0;mha(a,b+76|0);return}
>
> equivalent?
>
> I also take that the a=a|0;b=b|0 is mandatory to validate as asm.js, and
>
> function ila(a,b){mha(a|0,b|0+88|0);return}
> function jla(a,b){mha(a|0,b|0+84|0);return}
> function kla(a,b){mha(a|0,b|0+76|0);return}
>
> would not validate?
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to