Fix bug in ptr_subtype()
commite52b850ba2095181e43b9e4e9236d4d5794a64d6
authorBrett Simmers <bsimmers@fb.com>
Sun, 18 Oct 2015 22:29:40 +0000 (18 15:29 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Sun, 18 Oct 2015 23:00:28 +0000 (18 16:00 -0700)
tree5c1c97f00c3d239d6dd0956fed60bc0b006e9ee4
parent1c9f7452a2cc22af723066a261622b044221643b
Fix bug in ptr_subtype()

Summary: It used to think Unk was a subtype of Ref, because remove_ref(Ref) ==
Unk. Special case Unk before we get to the remove_ref() call, like other users
of remove_ref() do.

This was causing us to think that PtrToGen - PtrToRefGen was Bottom, messing up
alias analysis and causing load/store-elim to misbehave.

Reviewed By: alexmalyshev

Differential Revision: D2554135

fb-gh-sync-id: 0637ff0ae17002dbac260bd67b5718f586098d61
hphp/runtime/test/alias-class.cpp
hphp/runtime/test/type.cpp
hphp/runtime/vm/jit/memory-effects.cpp
hphp/runtime/vm/jit/memory-effects.h
hphp/runtime/vm/jit/type.cpp
hphp/test/slow/array_assignment/pgo-loadelim.php [new file with mode: 0644]
hphp/test/slow/array_assignment/pgo-loadelim.php.expect [new file with mode: 0644]
hphp/test/slow/array_assignment/pgo-loadelim.php.opts [new file with mode: 0644]