[llvm] WIP: [bolt][aarch64] Change indirect call instrumentation snippet (PR #180229)

Alexey Moksyakov via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 10 02:50:15 PST 2026


================
@@ -311,9 +311,12 @@ void Instrumentation::instrumentIndirectTarget(BinaryBasicBlock &BB,
                  : IndCallHandlerExitBBFunction->getSymbol(),
       IndCallSiteID, &*BC.Ctx);
 
-  Iter = BB.eraseInstruction(Iter);
-  Iter = insertInstructions(CounterInstrs, BB, Iter);
-  --Iter;
+  if (!BC.isAArch64()) {
+    Iter = BB.eraseInstruction(Iter);
+    Iter = insertInstructions(CounterInstrs, BB, Iter);
+    --Iter;
+  } else
+    Iter = insertInstructions(CounterInstrs, BB, Iter);
----------------
yavtuk wrote:

here we need to exclude erasing for original instruction due to annotation which  is lost in that case, I need to store original indirect call instruction with annotations.

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


More information about the llvm-commits mailing list