[MemorySSA] Update Phi simplification.
authorAlina Sbirlea <asbirlea@google.com>
Thu, 10 Oct 2019 23:27:21 +0000 (23:27 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Thu, 10 Oct 2019 23:27:21 +0000 (23:27 +0000)
commit6442b5697433e8306e5e5efbcee119931e88b274
treeb7b069e487741832be10ea7e3b12a1a7efb0c450
parent1ccb39bbd87cef11a023107d87d9ef5dffc86b81
[MemorySSA] Update Phi simplification.

When simplifying a Phi to the unique value found incoming, check that
there wasn't a Phi already created to break a cycle. If so, remove it.
Resolves PR43541.

Some additional nits included.

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