[llvm] [AArch64] Transform lsr + cbz/cbnz into cmp + bcc in loops (PR #228005)
Hari Limaye via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 2 03:23:14 PDT 2026
hazzlim wrote:
> > Is there some reason to prefer this over tst+b.eq?
>
> I don't see any difference. Are you saying `tst + b.eq` would be better?
Ah good point @efriedma-quic - we can avoid the extra MOV by doing
```
lsr x0, x0, imm
cbz x0, .LBB0
--------------->
tst x0, #(-1 << imm)
b.eq .LBB0
```
https://github.com/llvm/llvm-project/pull/228005
More information about the llvm-commits
mailing list