[PATCH] D134098: [BOLT] Add pass to fix ambiguous memory references
Rafael Auler via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 19 15:46:56 PDT 2022
rafauler marked 4 inline comments as done.
rafauler added inline comments.
================
Comment at: bolt/lib/Passes/ValidateMemRefs.cpp:87
+ LLVM_DEBUG(dbgs() << "BOLT-DEBUG: Starting memrefs validation pass\n");
+ for (auto &BFI : BC.getBinaryFunctions()) {
+ BinaryFunction &Function = BFI.second;
----------------
yota9 wrote:
> Just curious why not to parallel this?
I put up the basic scaffolding necessary to run this in parallel. It does run slower, though. The pass takes 8s wall time versus 3.7s sequential for a given test input. So I forced it run sequentially for now, but I left it there so we can easily change to run in parallel in case this changes.
The reason it runs slower is because we need to acquire a large lock to prevent data races from creating new symbols on line 47. Specifically, in BinaryContext::registerNameAtAddress, we hold iterators to a std::map and another thread might be changing this map.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134098/new/
https://reviews.llvm.org/D134098
More information about the llvm-commits
mailing list