MachineCSE pass has heuristics to check that common subexpression would increase register pressure. For example,
%1 = mov 0 %2 = add %1, ... ... %5 = mov 0 %6 = copy %5 --> it is copy for access subreg. ...
We can see a common sub expression mov 0 on above example and we can imagine the %5 can be removed. However, MachineCSE pass does not remove it because it could increase register pressure.
I agree with evan's commit message. If the MI does not use vreg, it just creates a live range and does not close any other vreg's live range. However, I feel it could be too conservative... I am not sure how we can improve the heuristics without performance regression so I would like to suggest to add an option which does CSE at all time.
Maybe name this AggressiveMachineCSE or something like it, to try and show that it overrides the profitability but not correctness.