[PATCH] D159520: [BOLT][AArch64] Fix instrumentation deadloop

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 02:08:50 PDT 2023


yota9 created this revision.
yota9 added reviewers: maksfb, rafauler, Amir.
Herald added subscribers: treapster, ayermolo, kristof.beyls.
Herald added a project: All.
yota9 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

According to ARMv8-a architecture reference manual E2.10.5 software
must avoid having any explicit memory accesses between exlusive load
and associated store instruction. Otherwise exlusive monitor might
clear the exlusivity without application-related cause which may
result in the deadloop. Disable instrumentation for such functions,
since between exlusive 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 exlusive store
is made make exlusive load and store sequentially, but for now just
disable instrumentation for such functions completely.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159520

Files:
  bolt/include/bolt/Core/MCPlusBuilder.h
  bolt/lib/Passes/Instrumentation.cpp
  bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
  bolt/test/AArch64/exlusive-instrument.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159520.556835.patch
Type: text/x-patch
Size: 4221 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230915/43d4c731/attachment.bin>


More information about the llvm-commits mailing list