Inline functions with TAILLCALL's
Inlining a function with a tailcall like any other function will break the tailcall (as it will cause the function calling the inlined function to return, and not the inlined function), we could however easily inline such a function according to the following rules:
- If the TAILCALL is recursive (i.e. calls the containing function itself) change it to a BRANCH to the Inlined entry block
- Otherwise expand out the tailcall into an equivalent pair of CALL and RET instructions, and inline as normal
In both these cases (assuming the function is otherwise suitable to inline), inlining should be more efficient than calling the function that tailcalls. However inlining functions (with or without tailcalls) may break OSR which seems to expect every function call to have it's own frame (except tailcalls replace the CALLER's frame).