Avoid forming tracelets that can't have IR fully emitted
commit973b65781cdd3caf9899d8c65ebf2ed28268edc3
authorGuilherme Ottoni <ottoni@fb.com>
Tue, 24 Feb 2015 19:24:53 +0000 (24 11:24 -0800)
committerhhvm-bot <hhvm-bot@fb.com>
Tue, 24 Feb 2015 19:30:31 +0000 (24 11:30 -0800)
tree3ea34815efebb51d6a0c0fc543cfe9f1ff6c9f7d
parent0669d2c6f458cec345c783ff4894d0bd0366e74a
Avoid forming tracelets that can't have IR fully emitted

Summary: I noticed that the tracelet selector was sometimes returning a
RegionDesc that didn't quite match the IR that would be emitted for it
(see examples in attached task).  So this diff puts in a check to make
sure that a tracelet RegionDesc always ends in an IR instruction
corresponding to its last bytecode instruction, and then fixes the
exposed issues.  The fix was basically to break the tracelet whenever
the IR that is produced for tracelet-formation purposes reaches a dead
end and the following IR blocks would be unreachable.

Reviewed By: @swtaarrs

Differential Revision: D1858456
hphp/runtime/vm/jit/prof-data.cpp
hphp/runtime/vm/jit/region-selection.cpp
hphp/runtime/vm/jit/region-selection.h
hphp/runtime/vm/jit/region-tracelet.cpp