[all-commits] [llvm/llvm-project] 846eb7: [BOLT][AArch64] Fix instrumentation deadloop

Vladislav Khmelevsky via All-commits all-commits at lists.llvm.org
Thu Sep 21 13:58:31 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 846eb76761c858cbfc75700bf68445e0e3ade48e
  Author: Vladislav Khmelevsky <och95 at yandex.ru>
  Date:   2023-09-22 (Fri, 22 Sep 2023)

  Changed paths:
    M bolt/include/bolt/Core/MCPlusBuilder.h
    M bolt/lib/Passes/Instrumentation.cpp
    M bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
    A bolt/test/AArch64/exclusive-instrument.s

  Log Message:
  [BOLT][AArch64] Fix instrumentation deadloop

According to ARMv8-a architecture reference manual B2.10.5 software
must avoid having any explicit memory accesses between exclusive load
and associated store instruction. Otherwise exclusive monitor might
clear the exclusivity without application-related cause which may
result in the deadloop. Disable instrumentation for such functions,
since between exclusive load and store there might be branches and we
would insert instrumentation snippet which contains loads and stores.

The better solution would be to analyze with BFS finding the exact BBs
between load and store and not instrumenting them. Or even better to
recognize such sequences and replace them with more complex one, e.g.
loading value non exclusively, and for the brach where exclusive store
is made make exclusive load and store sequentially, but for now just
disable instrumentation for such functions completely.

Differential Revision: https://reviews.llvm.org/D159520

More information about the All-commits mailing list