Reorganize final_pass
Summary:
This restructures final_pass to work unit-at-a-time, and to include
various other passes that were previously done single threaded on the
whole program after final_pass completed.
This might save a bit of time, but the ultimate goal is to merge unit
emission into final pass, so that we never have to keep all of the
final, optimized byte code in memory at one time.
This should be almost a no-op, except that the state_after("optimize")
pass now happens in parallel, on a per-unit basis, so its output (when
enabled) will be interleaved with the TRACE output of the optimize
pass.
Reviewed By: mofarrell
Differential Revision:
D15784166
fbshipit-source-id:
4f4ab6acac370600fc6881c77a490ed02feb788e