Un-gvn IsTypeStruct with resources since GVN doesn't work for things that can change...
commit8d36c2853d319d3b37fe9fb85c20a22e552cc99f
authorOguz Ulgen <oulgen@fb.com>
Wed, 29 Apr 2020 01:42:11 +0000 (28 18:42 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 30 Apr 2020 21:22:26 +0000 (30 14:22 -0700)
tree163c6a4d88492089277e0e94c211ad7a4ce7c5ab
parent13a0a731454505ae4f318f40f99164c3d4c36c5b
Un-gvn IsTypeStruct with resources since GVN doesn't work for things that can change without generating a new SSATmp

Summary:
GVN doesn't work on elements that are passed by reference since it assumes ssa form guarantees that if we are using the same ssa tmp, then nothing could have happened to the element but that's obviously not true for things passed by ref.

```
function main(): void {
  $res = fopen(__FILE__, 'r');
  if ($res is resource) {
    echo "resource\n";
  } else {
    echo "not resource\n";
  }

  fclose($res);

  if ($res is resource) {
    echo "resource\n";
  } else {
    echo "not resource\n";
  }
}
```
breaks since after the `fclose` `$res` is no longer a resource but GVN doesn't track this.

Reviewed By: ricklavoie

Differential Revision: D21288560

fbshipit-source-id: c85a6330edf11d4a3181ef6e864fedf9a9ec3a50
hphp/runtime/vm/jit/gvn.cpp