Not at present. Although the technique of using stubs is heavily used
in Flambda for other optimisations (for example where the argument
list of a function is going to be modified).
Mark
On 11 March 2016 at 09:09, Alain Frisch <alain.frisch@lexifi.com> wrote:
> On 11/03/2016 09:59, Mark Shinwell wrote:
>>
>> Also, for a function like the one you gave containing:
>>
>> if <cond> then <small expr> else <big expr>
>>
>> one of the reasons this should be kept in the .cmx files is because,
>> when the compiler comes to examine whether to inline it, it may be
>> able to fully evaluate <cond>. In particular when it's true then the
>> large expression can be eliminated completely (so long as <cond> is
>> not side-effecting). Another example is functions containing a large
>> match, where we may end up knowing which case is to be taken.
>
>
> For such cases, it is interesting to compile the function as a small stub
> that checks the condition or the match and jumps (tail call) into the proper
> sub-body. Only the stub (and potentially small enough sub-bodies) would be
> inlined, and the cmx would not need to store the large sub-bodies. Such
> approach was already taken for optional arguments, and I think that flambda
> already generalizes it. Would the case above be treated like that?
>
>
> Alain
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs