Mark Call and CallUnpack as producing reference
commitce48640b3af1b90ece6eb9c4591bcdb290b67521
authorJan Oravec <jan@fb.com>
Mon, 6 Apr 2020 03:20:46 +0000 (5 20:20 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 6 Apr 2020 03:22:49 +0000 (5 20:22 -0700)
treebb541ddf4c27004ad87182b031b80f654e2afdf3
parentb3f3d780339203bf3f45166635c780ef9e12824f
Mark Call and CallUnpack as producing reference

Summary:
IncRef/DecRef pairs on results of function calls were not getting optimized
away, such as in this example, where the pair was emitted around the
ConvObjToBool instruction, but not optimized away.

  $obj = get_object();
  if ($obj) {
    var_dump(get_class($obj));
  }

This was because the Call and CallUnpack opcodes were not marked as producing
reference, so refcount opts thought the DecRef may go to zero.

Reviewed By: ricklavoie

Differential Revision: D20861624

fbshipit-source-id: c5ead2e5700d6a8985ccf2145c847e5d664b1320
hphp/doc/ir.specification