Improvements to the computation of Vasm block and arc weights
commit550aaf71a9d9be2e65d228f862b91ef2f537b65a
authorGuilherme Ottoni <ottoni@fb.com>
Thu, 16 Nov 2017 17:50:57 +0000 (16 09:50 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 16 Nov 2017 17:53:20 +0000 (16 09:53 -0800)
tree706b989cd6f8596d96d1f7aac2676de2ea05ea26
parent4ccf487e848ef2a8c4a4dc43bd02eb569bc311dd
Improvements to the computation of Vasm block and arc weights

Summary:
This diff implements a couple of improvements in Vasm to how its block and arc
weights are computed, which affect code layout.

1) For the block weights, it adds a pass to make sure that a blocks weight doesn't exceed neither the weight of all its predecessors nor the weight of its successors.

2) For the arcs weights, it improves the computation of the weights of critical arcs.  Instead of always approximating the weight of this arcs, we now try to infer them as much as possible.

Reviewed By: swtaarrs

Differential Revision: D5291316

fbshipit-source-id: 30d6295344aa43529de59c7879616601cdd81eff
hphp/runtime/vm/jit/irlower.cpp
hphp/runtime/vm/jit/vasm-layout.cpp
hphp/runtime/vm/jit/vasm.h