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

    <tr>
        <th>Summary</th>
        <td>
            [GlobalISel] Unable to translate callbr to asm goto label
        </td>
    </tr>

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

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

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

<pre>
    Reproducer: https://godbolt.org/z/9joYWTbW4

The following C code:
```c
int foo(int count) {
  asm goto ("b %l[stop]" :::: stop);
  return count;
stop:
  return 0;
}
```
compiled for any global isel target (after adapting the jump instruction), produces the error:
```
fatal error: error in backend: unable to translate instruction: callbr (in function: foo)
```
Dumping the passes shows the input instruction:
```
  callbr void asm sideeffect "b ${0:l}", "!i"() #1
          to label %3 [label %2], !dbg !20, !srcloc !21
```
Works fine with SelectionDAG (or GCC).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVM1u4zgMfhr5Qkxg03EdH3xIGqTY684sij3KEm2ro4iGJLeYffqF5CSD7TYwQvPHH8mPlGQIZnJEvWhOojkXco0z-15OHCI7zwP5WAysf_V_0uJZr4q8qI8wx7gEUR8FXgReJtYD27hjPwm8_CPw0r3x368_hte9KM-iPG7_P2aCka3lD-MmeAbFmhLGFvJUbo_adOMijMwCD-lN8eqiwA5Ee9r8ADJcYeLIIPAgEAcQ2FjRnELkRTRngQgJ_f5AtmMn6geCp7h6dwO_m3PYvapHTPnwi_b8qeJNVXxdjCUNI3uQ7hdMlgdpwQSyEKWfKKZK5RjJg9RyiYmFOBO8rdcFjAvRryoadqlIfIYb3yHHkPfs_0_Wpo4ySvsI2V7AOBik-klOJ9vq5GAJIkP00gUrI_0nZX0EJa0dPGTGYVzdw5HH0H2Z-bxel3sbiwyBAoSZP7aajVvW-CnLlyhwz_3ORue5BqOJxpFU4iyPdi_aUynqo038IyaCsqhMFoe8HFhXd8T7LzJYOZBN21GDaE4PDfOSJJhKD1MSWN704JVllU3VlxW_sv8ZYDSO4MPEGb6Tpdzi-fiSGGQPL8_PArtdoftad3UnC-qrFtu2OmDZFnPf6VI2uq30AeU4qidV1gfaS1UfnnAcSBWmxxL3ZVeXVbuvsd3V7YgHVDg-NQPpphL7kq7S2J2179d0-AoTwkp9VZXNvipyoyGfbERHH5C9ia3mXPg-ffRtWKcg9qU1IYbfMNFEm6-El7zCf3wnK5oz_PXFDt0GF_n3ccx5i9Xb_tMtYeK8DjvFV4GXlOsmvi2e30hFgZdcYRB4ubXw3uO_AQAA__97d2Lp">