diff options
author | Ricardo Jesus <rjj@nvidia.com> | 2025-09-30 10:17:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-30 10:17:07 +0100 |
commit | 6b19ccdf64a0022b9665b61e4003b4e87643829b (patch) | |
tree | 769a6ebf412a179b274f3cf3fc8642ce6fce6796 /clang/lib/CodeGen/ModuleBuilder.cpp | |
parent | 88658dbbc510c78bce62005bf7cf35d5b869113c (diff) | |
download | llvm-6b19ccdf64a0022b9665b61e4003b4e87643829b.zip llvm-6b19ccdf64a0022b9665b61e4003b4e87643829b.tar.gz llvm-6b19ccdf64a0022b9665b61e4003b4e87643829b.tar.bz2 |
[AArch64] Simplify some masked integer comparisons. (#153783)
Specifically, `X & M ?= C --> (C << clz(M)) ?= (X << clz(M))` where M is
a non-empty sequence of ones starting at the least significant bit with
the remainder zero and C is a constant subset of M that cannot be
materialised into a SUBS (immediate). Proof:
https://alive2.llvm.org/ce/z/haqdJ4.
This improves the comparison in isinf, for example:
```cpp
int isinf(float x) {
return __builtin_isinf(x);
}
```
Before:
```
isinf:
fmov w9, s0
mov w8, #2139095040
and w9, w9, #0x7fffffff
cmp w9, w8
cset w0, eq
ret
```
After:
```
isinf:
fmov w9, s0
mov w8, #-16777216
cmp w8, w9, lsl #1
cset w0, eq
ret
```
Diffstat (limited to 'clang/lib/CodeGen/ModuleBuilder.cpp')
0 files changed, 0 insertions, 0 deletions