Optimize exceptional control flow
commit53879f0983c5bfed35ff8f5e284da22ff993456d
authorMark Williams <mwilliams@fb.com>
Thu, 23 Mar 2017 13:11:05 +0000 (23 06:11 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Thu, 23 Mar 2017 13:45:28 +0000 (23 06:45 -0700)
tree7669a4fabee9b3a50bc8cd02eed4201b0e5d6e9b
parent953c9372e497276defbf85a39f7195e008b96403
Optimize exceptional control flow

Summary:
The ExnNode tree has references to blocks, which can prevent things
being marked dead. We only recomputed it when we emitted the bytecode,
so a second invocation of hhbbc would have more optimization
opportunities.

This adds an optimization step. Initially, I called it along with the
other control flow optimizations, but that still resulted in
suboptimal code, because the extra edges would hinder the analysis
phase.

To fix this, I've moved it to the analysis phase; this is fine because
we never look at the internals of any Func other than the one we're
working on. If it ever does become a problem, we could move it to the
single-threaded update phase.

Reviewed By: ricklavoie

Differential Revision: D4750629

fbshipit-source-id: e59f8514ecb4bb590fdb986400cc8d20a855be46
hphp/hhbbc/analyze.cpp
hphp/hhbbc/cfg-opts.cpp
hphp/hhbbc/cfg-opts.h
hphp/hhbbc/emit.cpp
hphp/hhbbc/optimize.cpp
hphp/hhbbc/representation.h
hphp/hhbbc/show.cpp
hphp/util/compact-vector.h