[llvm] 86b249c - [ORC] Clear unused materializing info entries.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 22:51:12 PST 2021


Author: Lang Hames
Date: 2021-02-02T17:47:32+11:00
New Revision: 86b249c040ca7af31953ef304ac780502f2d285a

URL: https://github.com/llvm/llvm-project/commit/86b249c040ca7af31953ef304ac780502f2d285a
DIFF: https://github.com/llvm/llvm-project/commit/86b249c040ca7af31953ef304ac780502f2d285a.diff

LOG: [ORC] Clear unused materializing info entries.

Once a symbol is Ready its MaterializingInfo entry is unused and can be removed
to free up some memory.

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/Core.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/Core.cpp b/llvm/lib/ExecutionEngine/Orc/Core.cpp
index dfb558808c32..29591397b73e 100644
--- a/llvm/lib/ExecutionEngine/Orc/Core.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Core.cpp
@@ -1087,6 +1087,7 @@ Error JITDylib::emit(MaterializationResponsibility &MR,
                     CompletedQueries.insert(Q);
                   Q->removeQueryDependence(DependantJD, DependantName);
                 }
+                DependantJD.MaterializingInfos.erase(DependantMII);
               }
             }
           }
@@ -1102,6 +1103,7 @@ Error JITDylib::emit(MaterializationResponsibility &MR,
                 CompletedQueries.insert(Q);
               Q->removeQueryDependence(*this, Name);
             }
+            MaterializingInfos.erase(MII);
           }
         }
 
@@ -1373,6 +1375,11 @@ void JITDylib::dump(raw_ostream &OS) {
       OS << "      Unemitted Dependencies:\n";
       for (auto &KV2 : KV.second.UnemittedDependencies)
         OS << "        " << KV2.first->getName() << ": " << KV2.second << "\n";
+      assert((Symbols[KV.first].getState() != SymbolState::Ready ||
+              !KV.second.pendingQueries().empty() ||
+              !KV.second.Dependants.empty() ||
+              !KV.second.UnemittedDependencies.empty()) &&
+             "Stale materializing info entry");
     }
   });
 }


        


More information about the llvm-commits mailing list