| Issue |
207888
|
| Summary |
[X86][APX] x==0 ? 0 : x-1 should be optimized to adc with NDD
|
| Labels |
backend:X86,
missed-optimization
|
| Assignees |
|
| Reporter |
Andarwinux
|
https://godbolt.org/z/Kj417PW8s
noticed from #191488
```c++
int f(int x) { return x==0 ? 0 : x-1; }
```
gcc:
```asm
"f(int)":
cmp edi, 1
adc eax, edi, -1
ret
```
clang:
```asm
f(int):
xor eax, eax
sub edi, 1
cmovae eax, edi
ret
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs