ConstantHoisting: We can't insert instructions directly in front of a PHI node.

Insert before the terminating instruction of the dominating block instead.