Inline small cold functions into hot ones
commit24fa57241c9e3519e104cef8d6ca1cdc3e97e6f4
authorGuilherme Ottoni <ottoni@fb.com>
Wed, 6 Nov 2013 02:40:31 +0000 (5 18:40 -0800)
committerSara Golemon <sgolemon@fb.com>
Thu, 7 Nov 2013 13:11:42 +0000 (7 05:11 -0800)
treea90538804d6330d38388b986242d82de1474672a
parent4b9cf93acafd972c04abe251cc180c841aad736d
Inline small cold functions into hot ones

I noticed some missed opportunities for inlining were because the
callee was not marked as hot, but the caller was.  There's a check to
prevent inlining in such case, which kind of makes sense -- the call
may be in a cold path.  However, in some cases the callee is not
marked as hot probably just because it's too small.  And if the
function is small enough it's better to inline it anyway -- they code
may get smaller.  So I added a callee code-size threshold below which
inlining is always allowed.

I did some experiments with different values for the new threshold,
and also the previously existing HHIRInliningMaxCost, and set them to
what seems best these days.

Reviewed By: @jdelong

Differential Revision: D1044965
hphp/runtime/base/runtime-option.h
hphp/runtime/vm/jit/ir-translator.cpp