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

    <tr>
        <th>Summary</th>
        <td>
            [ARMv8] Backend Bugs
        </td>
    </tr>

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

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

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

<pre>
    I separate the bug report #67787 since the report has distinct bugs

### Discard Assembly Lines

Clang silently ignores the given instruction. Specifically, when I try to compile ARMv8 assembly code with the following instructions, it does not emit any machine code for it. We found such cases from `dsb`, `dmb`, and `isb` instructions.

```
$ ./bin/clang --version
clang version 16.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ cat buggy.s
    lsr r5, r5, #3
    dsb [R3,#1]
    dmb [R8]
 isb [R1,#1]
    lsr r5, r5, #3

$ bin/clang -c --target=armv8-linux-eabi buggy.s -o buggy.o

$ bin/arm-linux-gnueabi-objdump -d buggy.o

Disassembly of section .text:

00000000 <.text>:
   0:   e1a051a5        lsr     r5, r5, #3
 4:     e1a051a5        lsr     r5, r5, #3
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2PozgQ_TXmUgIZ8xE4cOjubKSRdi-zK-1xZewK1IyxI9vk49-vIHSnI_UcJkIE13v1Cr8yJUOgwSJ2rHpl1T6Rcxyd7y4Ue092SHqnb903CHiSXkaEOCL08wAeT85HYKKod7tmB4GsuqMbMsoAmkIkq-KSERjfM_6y3UVxv2BPQUmv4SUEnHpzgz_J4hP3zUg7QCCDNpob0GCdx7CWGuiMFsiG6GcVydkM_j6hoiMpacyNiTe4jGjhG0R_g-hAuelEBuHl-1_nBuR7TeU0woXiuKoenTHuQnb4rBwWMYqgHQawLgJOFEHaG0xSjWTxLnJ0Hihm8O_yOFsNYVYjKBkwwNG7CVjNdehZzRe9ZTG9L6TVS4BW9Kl09mRdzbdrc7KEjIlDT5aJg1q9StMz-kDO3in34BaCvM54tiX_I_2AkRUvcG3q_-oyne1P6y42NWTnazrYeeONHqWGyWk0C_vkAl2f-1mCkmufh1u2tQ8AwAQPvlq2d78zURQPVIceWPX6vWDijYkiZ9X-EzjdweYRpY2ff8X_danHOz65pCBN4-bAXvrp3Gz7RtnT-1Ygdduj-1pM-ulh15KZuv6HnqcTpPqrzD2Fj3PnjhBw7TFkEa9LJz5T-fYDVrxt-B8fFADg66LFXPIqlxUw3prgGW9_4Xj5e_yPk5bortBt0coEu7xuayHKQuySscsbVKKvUchS9m3etLtK53nRNrps2mrHE-oEF0XOueCVqMQu431-bASvedXXha4EKzlOkkxmzHnKnB8SCmHGrt61ZZsY2aMJ62gSwuIFVpAJsUwq3y056TpaSm4oxPBQiRTNOtPWL51Ve3iV6idaDa_zEJLZm26M8RQWR8SBicNAcZz7TLmJicMis_2lJ-9-oIpMHNbigYnD-nL_BwAA__-84o1q">