[erlang-bugs] inline & inline_effort

Anthony Ramine <>
Mon Sep 9 13:17:45 CEST 2013

Replied inline. Sorry for the dupe mail Tony, forgot to reply to all.

Le 9 sept. 2013 à 12:58, Tony Rogvall a écrit :

> I do not see what low level transformation has to do with anything in 
> the example I sent. It is just a plain module that illustrate some problem
> with an undocumented feature that I found looking through the code.
> (Upping the default inline_effort from 24 to say 100 might have exposed it anyway)

First I did say "btw" when mentioning the Core transforms, I was not trying to understand the bug itself.

The warnings are emitted because the inline code isn't marked as compiler generated and the third clause of the last function is not used in the inlining. As you say, the bug has nothing to do with the undocumented options.

> In the inline transform that I am writing I read forms from the beam files compiled with debug_info
> and then toss them into the module, cleaning and massaging a bit. It is not on core Erlang level at all.
> And does not have to be. The rest is passed on to the regular compiler to work on.

The scoping rules and structure of Core Erlang are easier to reason about when transforming code than the ones from Erlang. Even if you get the forms from debug_info nothing forbids you to compile them with {core_transform,SomeCoreTransform}. That's why Erlang's own inliner is a Core pass, not an Erlang one.

More information about the erlang-bugs mailing list