[PATCH] D141465: [BOLT][AArch64] add lock to FixRelaxations pass

Denis Revunov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 00:50:23 PST 2023


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

Since the pass is multithreaded, BC.Ctx must be protected. Otherwise we get crashes when processing.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141465

Files:
  bolt/lib/Passes/FixRelaxationPass.cpp


Index: bolt/lib/Passes/FixRelaxationPass.cpp
===================================================================
--- bolt/lib/Passes/FixRelaxationPass.cpp
+++ bolt/lib/Passes/FixRelaxationPass.cpp
@@ -39,6 +39,7 @@
       if (!Symbol || AdrpSymbol == Symbol)
         continue;
 
+      auto L = BC.scopeLock();
       const int64_t Addend = BC.MIB->getTargetAddend(Add);
       BC.MIB->setOperandToSymbolRef(Adrp, /*OpNum*/ 1, Symbol, Addend,
                                     BC.Ctx.get(), ELF::R_AARCH64_NONE);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141465.488102.patch
Type: text/x-patch
Size: 517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230111/bcc589d5/attachment.bin>


More information about the llvm-commits mailing list