[PATCH] D119674: [BOLT] Make BinaryFunction::eraseInvalidBBs() thread-safe

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 10:45:58 PST 2022


Amir added inline comments.


================
Comment at: bolt/lib/Core/BinaryFunction.cpp:352
+      if (BB->size()) {
+        std::unique_lock<std::shared_timed_mutex> Lock(BC.CtxMutex);
+        Bytes += BB->estimateSize();
----------------
yota9 wrote:
> Maybe move lock under estimateSize()? 
BB->estimateSize is called from two more places:
- ExtTSPReorderAlgorithm
- ReorderAlgorithm
which operate with an IndependentCodeEmitter and don't need locks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119674/new/

https://reviews.llvm.org/D119674



More information about the llvm-commits mailing list