MInstr memory effects improvements
commit9f095683428b1cfc305d0a52d854d9807a0a8363
authorBrett Simmers <bsimmers@fb.com>
Sat, 19 Dec 2015 05:25:36 +0000 (18 21:25 -0800)
committerhhvm-bot <hhvm-bot@fb.com>
Sat, 19 Dec 2015 05:30:37 +0000 (18 21:30 -0800)
tree94b1e6ee6161cf6bb80b198ff3ced700fc893dfe
parent427c029eb2d79277a1fb2d961c76dabbf513340f
MInstr memory effects improvements

Summary:
This adds a more general version of the property logic in
needFirstRatchet() that can apply to every dim, for both new and old
minstrs. When we detect a Prop dim that can't write to its tvRef argument, we
pass nullptr instead of a real pointer to tvRef. This lets us skip emitting
ratchet code and enables better load/store-elim.

I also made a number of tweaks to alias-analysis/memory-effects/load-elim:
- CGetElem and other read operations can't store to their base pointer.
- load-elim now knows that the pointee of CheckInitMem is Uninit on the taken
  path.
- AliasAnalysis::may_alias() was being too conservative with the MIS bits, a
  holdover from before each part of MInstrState had its own bit.
- Better pointee() for UnboxPtr.
- Rename Ptr::Misc to MMisc and add a new Misc that represents
  init_null_variant, null_variant, and lvalBlackHole.

Finally, reorganize the load() function in load-elim to be easier to follow and
allow eliminating some loads in catch blocks, when the value is constant or
defined in the same block as the load.

Reviewed By: alexmalyshev

Differential Revision: D2766587

fb-gh-sync-id: 1b9da0692ddc53deb7a04ff9d754ccad9b3e6f89
12 files changed:
hphp/runtime/base/attr.h
hphp/runtime/base/object-data.cpp
hphp/runtime/test/type.cpp
hphp/runtime/vm/class-inl.h
hphp/runtime/vm/class.h
hphp/runtime/vm/jit/alias-analysis.cpp
hphp/runtime/vm/jit/alias-analysis.h
hphp/runtime/vm/jit/code-gen-minstr-x64.cpp
hphp/runtime/vm/jit/irgen-minstr.cpp
hphp/runtime/vm/jit/load-elim.cpp
hphp/runtime/vm/jit/memory-effects.cpp
hphp/runtime/vm/jit/type.h