This is a WIP which is slowly being split into reviewable pieces:
- Assumes have landed under https://reviews.llvm.org/D50364.
- Guards have landed under https://reviews.llvm.org/D50501
- Invariant.Start finally landed as https://reviews.llvm.org/D51181.
Build off the approach pioneered in https://reviews.llvm.org/D46211, and apply the same reasoning to memory effects. Once we do this, we can hoist any intrinsic which has memory effects only for control flow modeling purposes (i.e. guards, assumes, invariant_start, and possibly others)
This needs a bunch of cleanup and likely some refactoring to LICM before landing. I'm posting it just so I don't forget where I was going.