Issue 164748
Summary aarch64: sbc is not being used
Labels new issue
Assignees
Reporter pinskia
    Take:
```
unsigned f1(unsigned a, unsigned b, unsigned c)
{
  unsigned t = a < b;
  return c - t;
}
```

LLVM produces:
```
f1:
        cmp     w0, w1
        cset    w8, lo
 sub     w0, w2, w8
        ret
```

The `cset/sub` combo should be replaced with:
```
        sbc     w0, w2, wzr
```

Which is what GCC produces:
```
f1:
        cmp     w0, w1
        sbc     w0, w2, wzr
 ret
```

https://godbolt.org/z/5f83qTK79
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to