[DO NOT MERGE, DISCUSSION PENDING]
Enabling MemorySSA in the old pass manager leads to MemorySSA being run
twice due to the fact that LCSSA and LoopSimplify do not preserve
MemorySSA. This is the first step to address that: target LCSSA.
LCSSA does not make any changes that invalidate MemorySSA, so it
preserves it by design.
While adding MemorySSA to LCSSA is straight forward, it's complicated by
the fact that the new pass manager instantiates a new AA for the loop
pass manager. After LCSSA (a function pass), the NPM creates the loop
pass pipeline with a new AA, and the preserved MSSA which retains a pointer
to the *old* AA.
This patch shows the updates needed inside MemorySSA (update AA in MSSA
and its walkers), and the corresponding test changes.
These updates most likely need to be extended to include the dom tree.
After this patch, MemorySSA is still run twice.
Step two follows: target LoopSimplify.