MemorySSA uses this algorithm. This moves the code around and changes the arguments so it can be reused in both places.
We don't have an SSAUtils.h or anything, but happy to put this wherever.
There are no actual algorithm or datastructure changes in here, just code movement.