[MemorySSA] Clear VisitedBlocks per query
authorWhitney Tsang <whitneyt@ca.ibm.com>
Fri, 18 Feb 2022 20:34:24 +0000 (15:34 -0500)
committerWhitney Tsang <whitneyt@ca.ibm.com>
Fri, 18 Feb 2022 20:36:19 +0000 (15:36 -0500)
commite7afbea8ca4e1c8239614aa37c2bd975172ddfa6
tree12383868dc0710da40fda22affa8723b97f66ea7
parent93e2b59c076e266e78627ff7cf1dc9ed7d85550d
[MemorySSA] Clear VisitedBlocks per query

The problem can be shown from the newly added test case.
There are two invocations to MemorySSAUpdater::moveToPlace, and the
internal data structure VisitedBlocks is changed in the first
invocation, and reused in the second invocation. In between the two
invocations, there is a change to the CFG, and MemorySSAUpdater is
notified about the change.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D119898
llvm/lib/Analysis/MemorySSAUpdater.cpp
llvm/unittests/Analysis/MemorySSATest.cpp