[llvm] r350783 - [MemorySSA] Remove optimized value when reseting optimized.

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 9 16:16:54 PST 2019


Author: asbirlea
Date: Wed Jan  9 16:16:54 2019
New Revision: 350783

URL: http://llvm.org/viewvc/llvm-project?rev=350783&view=rev
Log:
[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

Modified:
    llvm/trunk/include/llvm/Analysis/MemorySSA.h

Modified: llvm/trunk/include/llvm/Analysis/MemorySSA.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/MemorySSA.h?rev=350783&r1=350782&r2=350783&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/MemorySSA.h (original)
+++ llvm/trunk/include/llvm/Analysis/MemorySSA.h Wed Jan  9 16:16:54 2019
@@ -404,6 +404,7 @@ public:
 
   void resetOptimized() {
     OptimizedID = INVALID_MEMORYACCESS_ID;
+    setOperand(1, nullptr);
   }
 
   void print(raw_ostream &OS) const;




More information about the llvm-commits mailing list