One of the transformations done by PerformCMOVCombine increases DAG complexity so that one of the output values can be shared with the compare operation (written as a SUBS). Since this is the reverse of normal combining, it can be collapsed back later in the worklist, leading to an infinite loop.
I think there was a little existing logic to avoid this (the LHS != RHS check) , but it's fragile and nowhere near covers all possible combines; I could not extend it satisfactorily to cover this case and others.
So this patch changes the inserted ISD::SUB into a new ARMISD::OpaqueSUB with the same semantics but that doesn't undergo combining to avoid the problem.
Maybe just SUBS now? And with an updated comment.