Cross-module inlining fails

Sylvain Le Gall sylvain at le-gall.net
Mon Nov 19 18:00:17 GMT 2012


Hi,


2012/11/19 Markus Mottl <markus.mottl at gmail.com>

> Hi,
>
> I've noticed that cross-module inlining does not work with the
> Opam-installed Core library, because the .cmx file is not installed.
> Note that it is not enough to install the .cmxa file, because it is
> only used during linking.  The compiler wouldn't know where to look
> for optimization information.
>
> Looking at the setup.ml file generated by Oasis, it seems that Oasis
> is the culprit, but I thought it would be important to know for other
> Core users if they experience bad performance.
>
> Sylvain, is there anything one has to put in the _oasis file to
> generate correct installation code?  My guess is that all that's
> needed is to fix setup.ml by installing the .cmx of packing targets
> (e.g. core.cmx), not just .cmx files for constituents of unpacked
> libraries, which seem to be handled correctly.
>

Well, .cmx file should be installed EXCEPT if you are using packed
modules...

The culprit is:
(not lib.lib_pack) && (* Do not install .cmx packed submodules *)
in src/oasis/OASISLibrary.ml

AFAIK, Core use pack module, so this is the reason why it doesn't install
.cmx.

You can experiment installing .cmx by commenting this line. But I am really
not sure this will help that much. I thought that .cmxs was a pack of .cmx
so that inlining can work using what is inside this archive (contrary to
.cmxa).

Maybe the inlining using .cmxs doesn't work as excepted ?


> Regards,
> Markus
>
> --
> Markus Mottl        http://www.ocaml.info        markus.mottl at gmail.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocaml.org/pipermail/core/attachments/20121119/157b462c/attachment.html>


More information about the core mailing list