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

    <tr>
        <th>Summary</th>
        <td>
            【BOLT】【RISC-V】createInstrumentedIndCallHandlerExitBB() seems not to be implemented.
        </td>
    </tr>

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

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

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

<pre>
    When I want to run this command on RISC-V platform:

`
llvm-bolt mcf_s_base.mytest-64 -instrument -o mcf_s_base.mytest-64.instr_before
`
it occurs:
`
BOLT-INFO: shared object or position-independent executable detected
BOLT-INFO: Target architecture: riscv64
BOLT-INFO: BOLT version: <unknown>
BOLT-INFO: first alloc address is 0x0
BOLT-INFO: creating new program header table at address 0x200000, offset 0x200000
BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it.
BOLT-INFO: enabling relocation mode
BOLT-INFO: forcing -jump-tables=move for instrumentation
BOLT-INFO: 0 out of 49 functions in the binary (0.0%) have non-empty execution profile
not implemented
UNREACHABLE executed at /home/yjn/th1520_build/llvm-project-llvmorg-19.1.7/bolt/include/bolt/Core/MCPlusBuilder.h:2001!
 #0 0x0000003fb936bb64 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/sipeed/work_bolt/bolt_install/bin/../lib/libLLVMSupport.so.19.1+0x16bb64)
 #1 0x0000003fb9369d36 llvm::sys::RunSignalHandlers() (/home/sipeed/work_bolt/bolt_install/bin/../lib/libLLVMSupport.so.19.1+0x169d36)
 #2 0x0000003fb9369e90 SignalHandler(int) Signals.cpp:0:0
 #3 0x0000003fba35c800 (linux-vdso.so.1+0x800)
 #4 0x0000003fb90f7812 __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x0000003fb90b6be8 raise ./signal/../sysdeps/posix/raise.c:27:6
 #6 0x0000003fb90a6612 abort ./stdlib/abort.c:81:7
 #7 0x0000003fb92c04fe llvm::report_bad_alloc_error(char const*, bool) (/home/sipeed/work_bolt/bolt_install/bin/../lib/libLLVMSupport.so.19.1+0xc04fe)
 #8 0x0000003fb9c16c6c llvm::bolt::MCPlusBuilder::createInstrumentedIndirectCall(llvm::MCInst&&, llvm::MCSymbol*, int, llvm::MCContext*) (/home/sipeed/work_bolt/bolt_install/bin/../lib/../lib/libLLVMBOLTTargetRISCV.so.19.1+0x2c6c)
 #9 0x0000003fb852e8dc llvm::bolt::Instrumentation::createAuxiliaryFunctions(llvm::bolt::BinaryContext&) (/home/sipeed/work_bolt/bolt_install/bin/../lib/../lib/libLLVMBOLTPasses.so.19.1+0x8e8dc)
#10 0x0000003fb852f47a llvm::bolt::Instrumentation::runOnFunctions(llvm::bolt::BinaryContext&) (/home/sipeed/work_bolt/bolt_install/bin/../lib/../lib/libLLVMBOLTPasses.so.19.1+0x8f47a)
#11 0x0000003fb9d1e6a0 llvm::bolt::BinaryFunctionPassManager::runPasses() (/home/sipeed/work_bolt/bolt_install/bin/../lib/libLLVMBOLTRewrite.so.19.1+0x316a0)
#12 0x0000003fb9d20636 llvm::bolt::BinaryFunctionPassManager::runAllPasses(llvm::bolt::BinaryContext&) (/home/sipeed/work_bolt/bolt_install/bin/../lib/libLLVMBOLTRewrite.so.19.1+0x33636)
#13 0x0000003fb9d6cae0 llvm::bolt::RewriteInstance::runOptimizationPasses() (/home/sipeed/work_bolt/bolt_install/bin/../lib/libLLVMBOLTRewrite.so.19.1+0x7fae0)
#14 0x0000003fb9db90c4 llvm::bolt::RewriteInstance::run() (/home/sipeed/work_bolt/bolt_install/bin/../lib/libLLVMBOLTRewrite.so.19.1+0xcc0c4)
#15 0x0000002ad7d93914 main (/home/sipeed/work_bolt/bolt_install/bin/llvm-bolt+0x3914)
#16 0x0000003fb90a6bf0 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#17 0x0000003fb90a6c98 call_init ./csu/libc-start.c:128:20
#18 0x0000003fb90a6c98 __libc_start_main ./csu/libc-start.c:347:5
#19 0x0000002ad7d94078 _start (/home/sipeed/work_bolt/bolt_install/bin/llvm-bolt+0x4078)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: llvm-bolt mcf_s_base.mytest-64 -instrument -o mcf_s_base.mytest-64.instr_before
Aborted
`
I think this is becase createInstrumentedIndCallHandlerExitBB() not to be implemented. I don't find it in 
 bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp. I want know can I use this command on RISCV. or maybe have other alternative solution? 

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMWFtv2zgW_jXMy4EFirJl-8EPShrvGOgNTafzaFDkkc1GIgWSSuL99QtS8kVOFrsdtMUYbWxR5MfvOxfxHHHn1E4jrsjslsze3fDO741dSaUPh5vSyMPqrz1q2MAz1x68Adtp8HvlQJim4VqC0fBl83A3-QZtzX1lbEPu1-T2jiwLQuO_nBJa1PVTMylN7aER1dZtS-4waQ4enZ_kU5go7bztGtQeJubNOUmcsi2xMhZPuMqDEaKzbrRrvHX76f3Xyebj-hPJCnB7blGCKb-j8GAstMYpr4yeKC2xRS3D1viCovO8rBEkehQe5TXQV2536IFbsVdhRmcxDFvlxFM-vZ4dLuAJrVNGh2uS3XX6UZtnTbL768mVss4Dr2sjgEtp0TlQDujLKzXCIvdK70DjM7TW7CxvYI9cooWePvcnCPrCaPgQdgemqhz689CA-1fx5ePm478CtMSy24HSlYFnVddQIjhvVduihMqaBvweoVSa20MCfzqESddK7nESF04cimBVF2LlEbEF5ZNr9qh5WQf2FmsjeJgPjZH4yh7GijBt8r1r2knU5Uj2rjFPGO7BOWYixvVyCqbzYCqYLqHq9MBL6QsFQNiCJpSwGWFL2PMnBG30BJvWH4ZgCORaaypVB37aeFBNW2PYNQbHnx-_3Bd3fxS37--HFSiD9Qlb702DhK0P3zVha79PZ4xuy07VkrB1zIfW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