<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/114580>114580</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [AArch64] atomic operations with syncscope::SingleThread wrongly lower to proper atomics
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          gbaraldi
      </td>
    </tr>
</table>

<pre>
    I.e 
```llvm
define void @foo(ptr nonnull %myptr) {
top:
  store atomic i64 320, ptr %myptr syncscope("singlethread") release, align 8
  ret void
}
```
lowers to 
```s
_foo:                          ; @foo
        mov     w8, #320                        ; =0x140
 stlr    x8, [x0]
        ret
```

This seems incorrect given that
```llvm
define void @bar(ptr nonnull %myptr) {
top:
  store i64 320, ptr %myptr, align 8
  fence syncscope("singlethread") release
  ret void
}
```
Lowers to 
```s
_bar: ; @bar
        mov     w8, #320 ; =0x140
        str     x8, [x0]
        ret
```
I believe this requires a change in https://github.com/llvm/llvm-project/blob/8e61aaa0211a7d064139f29bebba833b7f3d1d18/llvm/lib/Target/AArch64/AArch64FastISel.cpp#L2195-L2204 but I'm not familiar enough with llvm backend specifics

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyclN9u6ygQxp8G34xOhAH_yYUv0o0iVerd6f0K8MRmF4MXcNK-_Qo7UXer9hy1KArG1nzDN7_RyBjN4BA7Uj2Q6ljIJY0-dIOSQdreFMr3r93jDoHQI6EHUtPtZ-1l2l71eDYO4eJND0TQs_eEtXMK4Lxzi7VAWDW9zikQtgfSPGxRyc-EH7ZngJh8QJDJT0aDqQVwRgn7A7LMPRziq9NR-xkJawlj0bjBYhoDyp4wltUDWpQRc6S0ZnDQ3hMETOsNby6a4zs729H6K4YIyb93G7fzn9kcP8Cni_CHew1uibc1-cu6X9t8N8I4Z_SXGvxIX0pxuxbEZEP-9LKFVw8vlFTH_6cImD70tP0_jyZCRJwiGKd9CKgTDOaCDtIo30d-ClfJ8F24n1D9gNUZncYv0P4S4qffIc4W-eFOMp9-T_IDZLcV0wruW-QeQaE1eEFImV7AfxYTMIIEPUo3IBgHY0pzzLVmJ8JOg0njonbaT4SdVojb9mMO_i_UibCTsl4RdmqxLqWUlJWlbHpai5Lvz2yvUCnZcq6aM-_Lvmz_o2Ny3LMMA2adwyHosRZvTycZ0-NPtDs9z4TxJ1buqx9PjFEBaknwSFgzgfMJznIy1sgA6PwyjHA1aYScBJTUf6PrIc6ozdnoG5Ki73i_53tZYFc2nIqWiZYXY1exspfNWVMu6rrdV7rVVKmmrahQfVnTwnSMMlGWtCwbLgTfiRbz3vCa9aLuKREUJ2nsLuff-TAUJsYFu7IUVUsLKxXauI5GxhxeYf2a2686FqFbS6uWIRJBrYkpvskkk-w6U-91qo738eZnDDIZ7-Jm_a3R-YHww8-10Z_XRodr8G6wr7AOpty0c8jhN6lYLMF2X26B1UQk7HRzeenYvwEAAP__g9K5QA">