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