Optimize no-op conditional jumps
commitcd728cce9133035e0fd5b8f8d71bdd3ce4b984ad
authorMark Williams <mwilliams@fb.com>
Fri, 10 Mar 2017 23:23:51 +0000 (10 15:23 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Fri, 10 Mar 2017 23:40:55 +0000 (10 15:40 -0800)
tree67c84c758d12f8aaff9563e69a4e9a32fbd78ec0
parentc6536517adc59399453814deb1906f94d4147f7b
Optimize no-op conditional jumps

Summary:
If a conditional branch branches around a block, and we optimize away
the contents of the block, we end up with a branch around a block
containing a single nop (hhbbc doesn't allow empty blocks).

This follows "nop" blocks at the fallthrough and target, and if they
end up at the same place, eliminates the jmp.

Reviewed By: ricklavoie

Differential Revision: D4689119

fbshipit-source-id: 5df824a31b597513859278ee17eabc5a6fe96928
hphp/hhbbc/interp.cpp