Fix optimize_builtin when not reducing
commitd254f4d130e531f5abcf7647993eca31a152dc9e
authorRick Lavoie <rlavoie@fb.com>
Fri, 3 Sep 2021 04:51:22 +0000 (2 21:51 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 3 Sep 2021 04:53:36 +0000 (2 21:53 -0700)
tree175b6c8a1519aa64891485237f449f9b705ee205
parentb5fbafcd207ccd57dbc20d66cf0a1e4abd15a7ef
Fix optimize_builtin when not reducing

Summary:
We'll only run optimize_builtin if will_reduce() returns true. The
idea is that if we're not going to reduce bytecodes, there's no
point. However, optimize_builtin can do more than just reduce
bytecodes, it can push a more refined type. So, when will_reduce()
returns false, we get no benefit of any of the type analysis. This is
probably, because one of the times when will_reduce() is false, is
when we're inserting the AssertRAT opcodes.

Just drop the will_reduce() check. If will_reduce() is false, any
reductions we perform will be no-ops (but will be analyzed for their
type effects), but any pushed types will be dealt with.

Reviewed By: mofarrell

Differential Revision: D30491072

fbshipit-source-id: 1bf5e0c86a47a454d8b4c9875369feffe6b4e08b
hphp/hhbbc/interp-builtin.cpp