[compiler-hacking] @inline attribute?

Pierre Chambart pierre.chambart at ocamlpro.com
Thu Oct 30 14:57:33 GMT 2014


On 30/10/2014 15:42, Leo White wrote:
>> I'm interested in people's thoughts on adding an @inline attribute,
>> along the lines of GHC's {-# INLINE #-}:
>>
>>    https://www.haskell.org/ghc/docs/7.0.2/html/users_guide/pragmas.html#inline-noinline-pragma
>>
>> It'd be useful to have a way of encouraging the compiler to inline
>> functions which its own heuristics might discount as too large or
>> otherwise too expensive.
> I'd like it to go one step further and give a warning or error if
> inlining could not be done for some reason (e.g. .cmx file not
> present). I think this is very much inline with OCaml's philosophy of
> predictable performance -- rather than just hope that the compiler
> inlines something I can be certain of it.
>
> Regards,
>
> Leo
>
It is certainly something that will get added at some point. Alain is
also interested in something like that.
-- 
Pierre


More information about the Cam-compiler-hacking mailing list