[llvm] [bolt][aarch64] Skip BB instrumentation with exclusive load/store instructions (PR #154734)

Rafael Auler via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 27 12:18:00 PDT 2025


rafaelauler wrote:

Hello @maksimra,

Thanks for looking into this matter and submitting a fix!

I'm concerned that a spanning tree-based reconstruction of edge counts depends on all leaf nodes being instrumented. If you omit one node, the reconstruction will corrupt random edge counts in a manner that is difficult to understand (as it depends on which nodes were skipped and how the spanning tree was constructed). This might create data that is not very useful for the purposes of basic block reordering, and it might be better to just rely on the original layout in these cases.

I have a few questions that would help me better understand this:

1. If using non-conservative mode, can't we skip the whole function? How prevalent are the exclusive load/store instructions? If they are rare, that would make the most sense for me.

2. If we can't skip the whole function, can we disable non-conservative mode entirely for Aarch64?

3. I assume this is hard or impossible, but for my education, is it possible to insert the instrumentation snippets even in basic blocks with exclusive load/store? What's stopping us from doing that?

Best,
Rafael

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


More information about the llvm-commits mailing list