https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79390
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Perhaps we just want to limit number of cmov converted insns in a bb rather than all noce* attempts, or we should also check how far is the user of the conditional move; on this exact testcase we turn one of the conditional insns into a maxsd (which supposedly has reasonable latency) and another one into cmov, but that one is consumed only by itself from earlier iteration and then whatever called the function. Perhaps noce_convert_multiple_sets should call in addition to noce_conversion_profitable_p some target hook that in the x86 case would count real cmove insns and for the ONE_IF_CONV... targets reject it only if there are more than one real cmove? I'm also surprised that the noce_convert_multiple_sets doesn't try all those other cases like abs, minmax, addcc, sign_mask etc. But apparently the backend manages to expand at least the minmax as such.