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

    <tr>
        <th>Summary</th>
        <td>
            [AArch64] Incorrect register used for inline assembly input
        </td>
    </tr>

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

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

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

<pre>
    ```llvm
define void @foo() {
  %1 = call i32 asm sideeffect "", "={x0},0"(i32 435)
  ret void
}
```

With `llc -march=aarch64 -O0`, this generates the following assembly.

```asm
foo:                                    // @foo
        .cfi_startproc
// %bb.0:
        mov     w8, #435
        mrs     x0, NZCV
        //APP
        //NO_APP
        ret
```

Using `={x0},{x0}` instead of `={x0},0` seems to avoid this issue, This IR is generated by rustc's inline assembly for an `inout("x8")` operand, so perhaps this is rustc's fault?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFU8tu3CAU_Rq8QbEY8HPhxSSjSNkkVdWH1E2EMbapMIwA5_H3veCZ6TSVWgth7sPnnnu47u3w3qGKbEvrlwWRAyL7QY7KSPxi1YBRQUZrEW0QbTGqb7cMjBEtdxixAxZca6wYxdwv2KtBynGUIkACTesundgBvn0jqD6Ah6RAEz8qWAnAZ1AnQ6q62TF5O5wpnsy0f1dhxom2wDcLd2KGIjy-qwLfPKV0KB5m5fEkjXQ8SA-mxKPV2r4qMwFlL5dev-fXwJdq0NDmiQIwoPf_B9F7WGfRTqBtLkb17AN34eisOLlPmbTs-5wA_CV7sS-wvzabdCwqdAk5D_tbauzxx923S2BD23_69MHz-PR87QR9_6HoVx81ic4_butyrAhWxgfJB2zHv_MiHPZSLqCyxTxNT1Jfeb_KSPlLtB4-46sbGXD_jt3qg0C0hlSj4-Sd7wWuymFuYi1l7BrSGNK3Js1PG-vZI8CYIaJ7i8GY-dGfy14Bj3zVAbH7THa7qiqbqqJNkQ0dG1rW8iyooGWHytv9Pg0QKg_4wQjrXBxlJycFfTu8eiAcOX3kqcxxDdnqdDeHcPTxOpP-Ewzp2ufCLmCkH2x73cAg_ARoMJM6Hg5lw4DS3BFCaiEL1u8qyuu2lrSpRDE0nFMxsHaXad5L7SNb0MHI17PAFFhnqqOE0h3ZlZSwhhR5K2tGCKdUUlE2pYDZlAtXOo88cuumzHWJUr9OHoIaWvW_g9CimoxM4kR8vobZum6_cKPkmqXSXaL-C7WfOGg">