]> granicus.if.org Git - llvm/commitdiff
[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)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350783 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/MemorySSA.h

index 7b6ad79fbe8808849c388a8f0cdefab2d252fbc1..17e2d0c73977098c00b6f6137ae99f6fde0db6ca 100644 (file)
@@ -404,6 +404,7 @@ public:
 
   void resetOptimized() {
     OptimizedID = INVALID_MEMORYACCESS_ID;
+    setOperand(1, nullptr);
   }
 
   void print(raw_ostream &OS) const;