From: Alina Sbirlea Date: Thu, 10 Jan 2019 00:16:54 +0000 (+0000) Subject: [MemorySSA] Remove optimized value when reseting optimized. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d70b6fe73653fdc60594e6a1536555918fca2c1c;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350783 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/MemorySSA.h b/include/llvm/Analysis/MemorySSA.h index 7b6ad79fbe8..17e2d0c7397 100644 --- a/include/llvm/Analysis/MemorySSA.h +++ b/include/llvm/Analysis/MemorySSA.h @@ -404,6 +404,7 @@ public: void resetOptimized() { OptimizedID = INVALID_MEMORYACCESS_ID; + setOperand(1, nullptr); } void print(raw_ostream &OS) const;