No, the compiler will never inline code from other modules. When the inline_list_funcs
option is given, the compiler uses hard-coded knowledge of a few of the functions in the lists
module.
Hot code upgrades would be much more complicated if inlining from remote modules were allowed. One way to handle it would be for the loader to load and unload all modules in an application (or other groups of modules) all at once. Another way would be for the compiler to generate code both with and without inlining and let the loader make sure that the correct version of the code would be used.
We have not tried to implement either of those ways to handle inlining combined with hot code upgrading, because all experiments we have done so far with inlining code between modules in applications such as compiler
and dialyzer
have been disappointing. The issue seems to be that function calls in BEAM are very fast, and thus inlining will only gain performance if the inlined code can be simplified. If the code cannot be simplified, inlining will increase the code size, which usually results in worse performance.