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

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 21 04:08:01 PDT 2025


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

Basic blocks with exclusive load/store instructions are skipped from instrumentation for aarch64. In case of non-conservative mode the spanning tree leaves BB must be skipped either if contains exclusive instructions.

Related to #153492 

>From 2bef8a986f26c5aad8e6756899ebd4cf62081120 Mon Sep 17 00:00:00 2001
From: RachinskiyMaksim <142528998+maksimra at users.noreply.github.com>
Date: Thu, 21 Aug 2025 13:54:34 +0300
Subject: [PATCH] [bolt][aarch64] Skip BB with exclusive load/store
 instructions from instrumentation spanning leaves

---
 bolt/lib/Passes/Instrumentation.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bolt/lib/Passes/Instrumentation.cpp b/bolt/lib/Passes/Instrumentation.cpp
index c2f876f0dff9e..ab54c2d68565f 100644
--- a/bolt/lib/Passes/Instrumentation.cpp
+++ b/bolt/lib/Passes/Instrumentation.cpp
@@ -579,6 +579,8 @@ void Instrumentation::instrumentFunction(BinaryFunction &Function,
   if (!opts::ConservativeInstrumentation) {
     for (auto BBI = Function.begin(), BBE = Function.end(); BBI != BBE; ++BBI) {
       BinaryBasicBlock &BB = *BBI;
+      if (BBToSkip.find(&BB) != BBToSkip.end())
+        continue;
       if (STOutSet[&BB].size() == 0)
         instrumentLeafNode(BB, BB.begin(), IsLeafFunction, *FuncDesc,
                            BBToID[&BB]);



More information about the llvm-commits mailing list