This sets the debug location from the old instructions when converting phi types.
The debug values may be more difficult to correct given that they are now a different type. Otherwise, I do not believe that debug instructions alters the optimization.
This is unrelated to your change (but is debug-info related), sorry for the extra noise...
It looks like we early-out of optimizePhiType here if II has a user which doesn't match the conditions above (i.e. not a phi, store, or bitcast). Couldn't this cause a change in behaviour based on debug-info if II is used by a debug intrinsic (isa<DbgVariableIntrinsic>(V))?