There's a stage in RS4GC when we remove all nodes from the state list if all of their inputs are base pointers.
Consider the following PHI:
loop: %ph = phi i8* [ %ph, %loop ], [ %b, %block ]
Say %b is a base value. Then we should remove the %ph from the states list, because it's equal to %b.
This patch just skips all the input values if they are equal to the value currently being processed.
If in the example above we had a user of %ph for which we were asked to find a base value,
we'd clone that user and replaced %ph uses with the %b base value.
With the patch %ph is treated as a base pointer, so no cloning happens.
What if V->stripPointerCasts() == BDV, will this still return false?