[llvm-branch-commits] [llvm] [BOLT] Gadget scanner: improve handling of unreachable basic blocks (PR #136183)

Anatoly Trosinenko via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu May 22 04:12:11 PDT 2025


atrosinenko wrote:

@jacobbramley As far as I can see, one possible reason for some control flow not to be detected is that BOLT does not detect jump tables correctly on AArch64. When I tried to debug this some time ago, it looked to me like branch instructions related to jump tables are analyzed in [`AArch64MCPlusBuilder::analyzeIndirectBranchFragment`](https://github.com/llvm/llvm-project/blob/c42c91cde41bc403aaf733ebe3ef849861e08dde/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp#L1237), but then some/all detected instructions are ignored. Furthermore, it looks like there are recent attempts to improve this, such as #132114.

That is, incomplete CFG information not necessarily indicates a bug in the binary, but it definitely indicates the *analysis* is less reliable for the entire function, thus reporting a warning.

https://github.com/llvm/llvm-project/pull/136183


More information about the llvm-branch-commits mailing list