[MemorySSA] Add API to update MemoryPhis, following CFG changes.
authorAlina Sbirlea <asbirlea@google.com>
Fri, 20 Jul 2018 17:13:05 +0000 (17:13 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Fri, 20 Jul 2018 17:13:05 +0000 (17:13 +0000)
commit20c2962585f250d119c5b32dde344ed49af4ec7f
tree0cc64c88048e5e8545df94c776003cb848ea83b3
parentdbfa453e4138bb977644929c69d1c71e5e8b4bee
[MemorySSA] Add API to update MemoryPhis, following CFG changes.

Summary:
When splitting predecessors in BasicBlockUtils, we create a new block as an immediate predecessor of the original BB, then we connect a given set of predecessors to the new block.
The API in this patch will be used to update MemoryPhis for this CFG change.
If all predecessors are being moved, we move the MemoryPhi directly. Otherwise we create a new MemoryPhi in the NewBB and populate its incoming values, while deleting them from BB's Phi.
[Split from D45299 for easier review]

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

Differential Revision: https://reviews.llvm.org/D49156

llvm-svn: 337581
llvm/include/llvm/Analysis/MemorySSA.h
llvm/include/llvm/Analysis/MemorySSAUpdater.h
llvm/lib/Analysis/MemorySSAUpdater.cpp