I am not sure my fix is the best approach, but it fixes the assertion of "Incomplete phi during partial rename". Could it be an issue with how I use the MemorySSAUpdater in the test case?
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.