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

    <tr>
        <th>Summary</th>
        <td>
            [BOLT] Bolt cannot correctly recognize tail calls on aarch64.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            BOLT
      </td>
    </tr>

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

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

<pre>
    ![image](https://github.com/llvm/llvm-project/assets/81171521/4932dd9e-fce9-4fa4-9201-0136ddfeb601)
![image](https://github.com/llvm/llvm-project/assets/81171521/e9ad2013-1bcd-46d3-a9f0-dc4a281a7789)
![image](https://github.com/llvm/llvm-project/assets/81171521/a43d559b-28aa-4d08-abf5-a578020feddf)
I traced this function using GDB and found that the BR instruction is actually a tail call, but the result of BC.MIB->isTailCall() is false.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0krGO3SwQhZ8GNwgLBmND4WK997-_VkoUKdkm5RiwTcSalYFIN08fXa-SrVNsNc2Z0TfnHMw5rLv3I1ETUZcGa9nSMX6vuH_bkDdzcreRgCBqCi-4eqIuBPRWymsm8oHAlcB1DWWrc2vTC4FrjD__DPZ6pB_eFgJXzNmXTOCqhRiEAkHg2hkJzhnPFusN6xbsmAEuGBeyd27xc88FAUP4hfCHj0HwBh1wIZmYrWNd7yRDs3DmbIegBQ6DNh-MgJ10SpmZgUZkneOa4bwohmrQHPjinVv-IjzRcqD1jpYtZLrU3ZaQdlpz2Ff6_2WiuDu6pLrfFVho2TydvtKw53LUN23IFG2pGOONIi0YIrUYI4FHOte3jcPnGgtNC50e289PEyPyv5CfMcTHU6kJmPudBWP2beNG6Yw02Pjx_KqTRvBmG63VSjoziGEQxktEM1jQ1lkne9_boQkjcOi44oZrqSVvZy-Mxd5YqWGQFknH_QuG2N59bNOxNiHn6kcj1CCaiLOP-SwuwPTl0zMBuFf4GE_b57pm0vEYcsnvB0oo8Sz7uaAudEqxUIv7ngq16Ti8LfFGD2_Tuodf_t2hTNNOEQ-79V3b1COO_5z_SX_P_3zgdwAAAP__25MSBw">