Issue 207886
Summary [X86][APX] missed ccmp optimization
Labels backend:X86, missed-optimization
Assignees
Reporter Andarwinux
    https://godbolt.org/z/c3hc3jqcY
```c++
int foo_apx(int a, int b, int c, int d) {
  if (b != d && a < c || a > d) {
 return b;
  }
  return a;
}
```
gcc:
```asm
"foo_apx(int, int, int, int)":
  cmp esi, ecx
  ccmpne {dfv=sf, of} edi, edx
  ccmpge {dfv=sf} ecx, edi
  cmovl eax, edi, esi
  ret
```
clang:
```asm
foo_apx(int, int, int, int):
  cmp esi, ecx
  cmovne eax, edi, esi
  cmp edi, edx
 cmovge eax, edi
  cmp edi, ecx
  cmovg eax, esi
  ret
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to