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

    <tr>
        <th>Summary</th>
        <td>
            BOLT instrumentation fails on aarch64 due to an unsupported CFI opcode
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          sfc-gh-tmarzec
      </td>
    </tr>
</table>

<pre>
    I'm trying to use BOLT to optimize an aarch64 binary.
When I run the following command:
```
llvm-bolt a.out -instrument --instrumentation-file-append-pid -o a.instrumented
```
The build fails. This is the error message I'm getting:
```
BOLT-INFO: Target architecture: aarch64
BOLT-INFO: BOLT version: <unknown>
BOLT-INFO: first alloc address is 0x200000
BOLT-INFO: creating new program header table at address 0x2600000, offset 0x2400000
BOLT-INFO: enabling relocation mode
BOLT-INFO: forcing -jump-tables=move for instrumentation
BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
BOLT-WARNING: reference in the middle of instruction detected in function Builtins_JSConstructStubGeneric/1 at offset 0x40
unsupported CFI opcode
UNREACHABLE executed at /tmp/clang-build-tmarzec/src/bolt/lib/Core/BinaryFunction.cpp:2465!
unsupported CFI opcode
UNREACHABLE executed at /tmp/clang-build-tmarzec/src/bolt/lib/Core/BinaryFunction.cpp:2465!
/bin/sh: line 1: 975005 Aborted                 (core dumped) ...
```

Both BOLT and a.out binaries are compiled with GCC. I'm using version of LLVM from this commit: https://github.com/llvm/llvm-project/commit/87e9c42495aa4d290b04fa2866ec0e627a54842a.
I checked, and that opcode is `OpNegateRAState`.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVU1v4zgP_jXKhbAhy46THHJIM3XfvOi2QNvdOS5kibY1I0uGPvoxv34hx-0Misxhb2sEsSWQj8iH5CPuveoN4p6sr8j6y4rHMFi3953I-iELI3c_UKxaK9_2J8I2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