|Description||I propose to add a feature for controlling inlining, in order to prevent performance bugs like 0005872.|
There are basically two options: instruct the compiler about inlining, or check inlining afterward:
1) The compiler could honour a new command-line option [-inline-function name] which would recommend this function for inlining. If it is not inlined, a warning is emitted (and if the warning is fatal, an error).
2) Extend ocamlobjinfo so that it can check whether a function was inlined. Add switch: [-check-inlining name] which outputs something when the function (identified by an OCaml identifier, not by an asm symbol) is not marked for inlining, and the exit code is non-0 in this case.
Of course, the goal of adding such a feature is to include the recommendations or checks into the build, so that we get automation. This is especially useful because OCaml doesn't define when inlining is possible, and because every OCaml version may behave differently in this respect.