Add initial framework for PGO in the JIT, and use it for trace-region selection
commitd078c2b895fa8a474c48f2d3b98292fadae08062
authorGuilherme Ottoni <ottoni@fb.com>
Wed, 5 Jun 2013 00:25:42 +0000 (4 17:25 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 24 Jul 2013 17:35:45 +0000 (24 10:35 -0700)
tree133ea1f6443bb26bd0971586cf804c31eefc0808
parent0d0748302c67ec25b65cde614823d73df2e41536
Add initial framework for PGO in the JIT, and use it for trace-region selection

This diff adds an initial framework for profile-guided optimizations
in the JIT.  Two new translation modes are added, effectively creating
a multi-gear JIT:

  1. Profile: this collects profiling data, which includes execution
              counters and type information.
  2. Optimize: this uses data collected by Profiling translations to
               produce optimized translations.

Right now, the Optimize gear is solely used to produce larger
compilation regions (traces), which increase the scope of
optimizations exposed to the JIT (compared to tracelets).  This is
still work in progress, and it's disabled by default.

This diff also fixes a number of bugs exposed by trace regions, gets
tools/reduce working again, and makes a number of improvements to
tc-print related to the new translation modes.
38 files changed:
hphp/doc/ir.specification
hphp/runtime/base/program_functions.cpp
hphp/runtime/base/runtime_option.cpp
hphp/runtime/base/runtime_option.h
hphp/runtime/base/types.h
hphp/runtime/vm/func.cpp
hphp/runtime/vm/func.h
hphp/runtime/vm/jit/abi-x64.h
hphp/runtime/vm/jit/code-gen.cpp
hphp/runtime/vm/jit/dce.cpp
hphp/runtime/vm/jit/extra-data.h
hphp/runtime/vm/jit/hhbc-translator.cpp
hphp/runtime/vm/jit/hhbc-translator.h
hphp/runtime/vm/jit/ir-translator.cpp
hphp/runtime/vm/jit/ir.h
hphp/runtime/vm/jit/prof-data.cpp [new file with mode: 0644]
hphp/runtime/vm/jit/prof-data.h [new file with mode: 0644]
hphp/runtime/vm/jit/region-hot-block.cpp [copied from hphp/runtime/vm/jit/types.h with 56% similarity]
hphp/runtime/vm/jit/region-hot-trace.cpp [new file with mode: 0644]
hphp/runtime/vm/jit/region-method.cpp
hphp/runtime/vm/jit/region-onebc.cpp
hphp/runtime/vm/jit/region-selection.cpp
hphp/runtime/vm/jit/region-selection.h
hphp/runtime/vm/jit/region-tracelet.cpp
hphp/runtime/vm/jit/srcdb.cpp
hphp/runtime/vm/jit/srcdb.h
hphp/runtime/vm/jit/trace-builder.cpp
hphp/runtime/vm/jit/trans-cfg.cpp [new file with mode: 0644]
hphp/runtime/vm/jit/trans-cfg.h [new file with mode: 0644]
hphp/runtime/vm/jit/translator-x64-helpers.cpp
hphp/runtime/vm/jit/translator-x64.cpp
hphp/runtime/vm/jit/translator-x64.h
hphp/runtime/vm/jit/translator.cpp
hphp/runtime/vm/jit/translator.h
hphp/runtime/vm/jit/types.h
hphp/runtime/vm/srckey.h
hphp/runtime/vm/unit.h
hphp/util/trace.h