Fix refcount issues in gvn
commit088bdabf1ee0b4e7c0be968304f45cbc34cfd22f
authorMark Williams <mwilliams@fb.com>
Sat, 6 Jan 2018 01:41:20 +0000 (5 17:41 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Sat, 6 Jan 2018 01:55:04 +0000 (5 17:55 -0800)
tree40e3ed734e4f3c7650e74ef3e3948ee1aca5abe6
parent7516eec3283d92bb5e353cea60561379312165f4
Fix refcount issues in gvn

Summary:
gvn was conservatively inserting IncRefs for instructions marked PRc,
ignoring the fact that not all replacements would be reached on all
paths.

This finds the places to insert IncRefs and DecRefs. In most cases,
refcount-opts will be able to kill everything it inserts (which it
couldn't before because the IncRefs generally weren't balanced).

Reviewed By: swtaarrs

Differential Revision: D6648654

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