[llvm] Reduce llvm-gsymutil memory usage (PR #91023)

Kevin Frei via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 17:33:16 PDT 2024


================
@@ -658,6 +711,9 @@ void DWARFUnit::clearDIEs(bool KeepCUDie) {
   // It depends on the implementation whether the request is fulfilled.
   // Create a new vector with a small capacity and assign it to the DieArray to
   // have previous contents freed.
+  llvm::sys::ScopedWriter FreeLock(CUDieFreeMutex);
+  llvm::sys::ScopedWriter CULock(CUDieArrayMutex);
+  llvm::sys::ScopedWriter AllLock(AllDieArrayMutex);
----------------
kevinfrei wrote:

I believe taking all 3 locks is overkill, as getting the CUDieFreeMutex writer lock will block until the CUDie and AllDie locks are free. Thoughts?

https://github.com/llvm/llvm-project/pull/91023


More information about the llvm-commits mailing list