Currently, the inliner does not take into account if a call is inside a loop. Providing LoopInfo to the inliner would make more informed inlining decisions for calls which are inside a loop.
Passes regression tests.
I'll can more benchmark numbers if this approach appears good enough. If there is a better way to port loop info, please let me know as I can work towards implementing that.