[MemorySSA] Update Phi insertion.
authorAlina Sbirlea <asbirlea@google.com>
Mon, 23 Sep 2019 23:50:16 +0000 (23:50 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Mon, 23 Sep 2019 23:50:16 +0000 (23:50 +0000)
commit2c5e6646ef1300f6bff212d607e50057a637f271
tree6415c8bdbae95594de985d75b2328b8e1eee77fb
parent5c49c267147cae358bdc9bbede532320a75c5933
[MemorySSA] Update Phi insertion.

Summary:
MemoryPhis may be needed following a Def insertion inthe IDF of all the
new accesses added (phis + potentially a def). Ensure this also  occurs when
only the new MemoryPhis are the defining accesses.

Note: The need for computing IDF here is because of new Phis added with
edges incoming from unreachable code, Phis that had previously been
simplified. The preferred solution is to not reintroduce such Phis.
This patch is the needed fix while working on the preferred solution.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

llvm-svn: 372673
llvm/lib/Analysis/MemorySSAUpdater.cpp
llvm/test/Analysis/MemorySSA/pr43317.ll [new file with mode: 0644]