[PATCH] D121337: [BOLT][NFC] Fix print-cfg data race

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 20:28:16 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGd1638cb0b5b2: [BOLT][NFC] Fix print-cfg data race (authored by Amir).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121337

Files:
  bolt/lib/Rewrite/RewriteInstance.cpp


Index: bolt/lib/Rewrite/RewriteInstance.cpp
===================================================================
--- bolt/lib/Rewrite/RewriteInstance.cpp
+++ bolt/lib/Rewrite/RewriteInstance.cpp
@@ -2950,8 +2950,10 @@
         if (!BF.buildCFG(AllocId))
           return;
 
-        if (opts::PrintAll)
+        if (opts::PrintAll) {
+          auto L = BC->scopeLock();
           BF.print(outs(), "while building cfg", true);
+        }
       };
 
   ParallelUtilities::PredicateTy SkipPredicate = [&](const BinaryFunction &BF) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121337.414269.patch
Type: text/x-patch
Size: 533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220310/f0b9f608/attachment.bin>


More information about the llvm-commits mailing list