Add a profile-guided code layout pass
commitee02cb3660d9ee29bf6eb176c03d803a6e8ab657
authorGuilherme Ottoni <ottoni@fb.com>
Mon, 18 May 2015 17:35:28 +0000 (18 10:35 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Mon, 18 May 2015 18:00:34 +0000 (18 11:00 -0700)
treee7b620586b49fdedc61af81047fe750ec9856a8c
parent21bec8823465677bb24d249a0bbd35f81ec89129
Add a profile-guided code layout pass

Summary: This diff implements a profile-guided code layout pass, and enables it
for all PGO-based, Optimize translations.  The method implemented here
is described in "Profile Guided Code Positioning" (PLDI'1990) by
Pettis & Hansen (more specifically, Algo2, from section 4.2.1).  This
implementation uses estimated arc weights derived from a combination
of profile counters inserted at the bytecode-level blocks (in Profile
translations) and the JIT-time Likely/Unlikely/Unused hints (encoded
in the "area" field of the Vblocks).

Reviewed By: @jdelong

Differential Revision: D2073974
hphp/runtime/vm/jit/timer.h
hphp/runtime/vm/jit/vasm-layout.cpp [new file with mode: 0644]
hphp/runtime/vm/jit/vasm-print.cpp
hphp/runtime/vm/jit/vasm-x64.cpp
hphp/runtime/vm/jit/vasm.cpp
hphp/runtime/vm/jit/vasm.h
hphp/util/trace.h