Skip to content

Commit b236d7e

Browse files
committed
[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
1 parent c38c9c1 commit b236d7e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/include/llvm/Analysis/MemorySSA.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ class MemoryDef final : public MemoryUseOrDef {
404404

405405
void resetOptimized() {
406406
OptimizedID = INVALID_MEMORYACCESS_ID;
407+
setOperand(1, nullptr);
407408
}
408409

409410
void print(raw_ostream &OS) const;

0 commit comments

Comments
 (0)