Open
Description
https://godbolt.org/z/vrexqnWoe
There is nothing wrong with:
add edi, esi
mov eax, edi
sub edi, edx
cmovnc eax, edi
ret
But the two-address pass makes it:
lea eax, [rdi + rsi]
xor ecx, ecx
cmp eax, edx
cmovae ecx, edx
sub eax, ecx
ret
which is actually less optimal.