The instruction simplification will try to simplify the affected phis.
In some cases, this might extend the liveness of values. For example:
BB0: | \ | BB1 | / BB2:phi (BB0, v), (BB1, undef)
The phi in BB2 will be simplified to v as v dominates BB2, but this is
increasing the number of active values in BB1. By setting CanUseUndef
to false, we will not simplify the phi in this way, this would help
register pressure. This is mandatory for the later change to help
reducing VGPR pressure for AMDGPU.
Not your fault, but bb.2 really should have been removed because it only contains an implicit def which does not generate any code.