This patch re-adds two of the optimizations that were taken out of MemorySSA due to sketchiness.
Specifically:
- We now try to take advantage of memory ordering rules on loads before querying AA
- We recognize and appropriately react to invariant loads, and loads that AA can prove point constant memory.
Note that the memory ordering check was strengthened to Monotonic, because that's the equivalent of std::memory_order_relaxed, which guarantees no ordering whatsoever, AFAIK.
Also note that I'm not an expert in memory models. So if anything seems fishy, let me know. :)