<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68465>68465</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AArch64] Combine cmp + cset into eor
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vfdff
</td>
</tr>
</table>
<pre>
* test: https://gcc.godbolt.org/z/fM7hnMohb
```
static A staticA;
A* Test::aPtr = &staticA;
int main() {
if (!staticA.isDisabled())
return 1;
return 0;
}
```
* clang:
```
main: // @main
adrp x8, _ZL7staticA
ldrb w8, [x8, :lo12:_ZL7staticA]
cmp w8, #0
cset w0, eq
ret
```
* gcc:
```
main:
adrp x0, .LANCHOR0
ldrb w0, [x0, #:lo12:.LANCHOR0]
eor w0, w0, 1
ret
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEU09vnD4Q_TTDZRRkxvw9cPAGod8h-bWqeuqlMmDAlRe22Ju0_fQVBrJplKqSZeDNvJn3bEZaq4dJqRKSEyRVIK9unJfyqe_6Pmjm7mcJJNAp64ALHJ27WOACqAaqh7YNh7lrZuPCeRmA6l9Adf-YjdPjPDbAKmACUrYv_2mddLpFgduLAH7aAmLt83nrA1zIj25B4BUCpW9Tt11PDs9ST0A5UIGQ7VFERN2jh6OdGmpbaSsbo7otfV0v2YiLctdlwgj4CQ98x9itbVa9a2nfSWBr5DSs-t9L81q5wO3sEGLmkb2b7JYL_siB7vHrl4fssLxHTbc0-OyjkJy2NODCzBEBF68JSXVw2vPloBBnL6hVDp_ZCqvvr6y-74wEDm37D0d_WvClwwfx__1_Hz4dbTf97NDPdlU3CzfCzYCal52z7dHf5QZdybuCFzJQZZQWaRoXcZQFY5kUeUNdL7uuTyMeR6RylcYsVzwnybIi0CUx4hFjGeOcRVmYRlTkCcVtwpM-yjuImTpLbUJjns7rbx5oa6-qTPM4TQIjG2WsHx6iST2jDwLROktLuXLumutgIWZGW2dvVZx2xk-dEEs7pjEkFd7P50ZPyl8d0Gm7LD25eT2L4LqY8s0Aajdem7Cdz0D1Wnl_3F2W-ZtqHVDt9Vig2uv9HQAA__9V8RFB">