This patch adds one profitable pattern to sink MI when MI->parent() dominates SuccToSinkTo and SuccToSinkTo post dominates MI->parent().
If MI is in loop and MI is:
def0, def1, defn = opcode, use0, use1, use2, use3
sinking MI to SuccToSinkTo will shorten the live range for def but will enlarge the live range for use.
But in loop, the use may be defined outside of loop, so if SuccToSinkTo is still in same loop, sinking MI should have no impact for the live range for the uses which are defined out of loop.
If we know that all the uses are defined outside of loop, it is still profitable to sink.
Could you invert the logic to early exit and reduce the indentation here?