Open bluddy opened 8 years ago
Something enabling that (not only when inlined in fact) has been attempted before, see https://github.com/chambart/ocaml/tree/float_args This will definitely be done at some point, but needs some big changes in the backend first: https://github.com/OCamlPro/flambda-task-force/issues/153
There are really two ways to attack the problem: either support unboxed calling conventions in general, or optimize the recursive loop into a function-local loop (perhaps using "extended local exceptions") and then rely on the current unboxing strategy (in cmmgen). The latter is more restricted in scope but also simpler to achieve and it could give better performance (in addition to avoiding unboxing, it could benefit from better register allocation).
In the following example, x is not unboxed: