[MemorySSA] Remove optimized value when reseting optimized.
authorAlina Sbirlea <asbirlea@google.com>
Thu, 10 Jan 2019 00:16:54 +0000 (00:16 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Thu, 10 Jan 2019 00:16:54 +0000 (00:16 +0000)
commitb236d7e7a915fa1ddf536d069003b5181a354492
tree13db8c17d397987006fea69c6d5ffbfc6f065baf
parentc38c9c120f3583eed698f5c0e3e21b4c03f6ad61
[MemorySSA] Remove optimized value when reseting optimized.

Summary:
If we don't reset the optimized value O for access A, even though A is no longer optimized to O, A will still show up in that O's users list.
This fails verification when hoisting a Def outside a loop, even though the updates are correct.
The reason is that the phi in the loop header still find as user the hoisted def, because the Def has a pointer to the Phi in its optimized operand.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

llvm-svn: 350783
llvm/include/llvm/Analysis/MemorySSA.h