[llvm] b883091 - [ORC] Further simplify ContainerElementsMap::hoistDeps. NFCI. (#185242)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 7 19:28:08 PST 2026


Author: Lang Hames
Date: 2026-03-08T14:28:04+11:00
New Revision: b883091badd812063adff715f27e414af74b371c

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

LOG: [ORC] Further simplify ContainerElementsMap::hoistDeps. NFCI. (#185242)

At the one call-site where the result of hoistDeps is used,
self-dependencies will already have been eliminated. That means we can
use the "deps changed" property that we're already computing rather than
tracking "deps graph changed" separately.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/Orc/WaitingOnGraph.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/WaitingOnGraph.h b/llvm/include/llvm/ExecutionEngine/Orc/WaitingOnGraph.h
index 2ffd6bd6cbffd..28780b0433bda 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/WaitingOnGraph.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/WaitingOnGraph.h
@@ -280,9 +280,7 @@ template <typename ContainerIdT, typename ElementIdT> class WaitingOnGraph {
     /// Returns true if SuperNodeDeps was changed.
     bool hoistDeps(SuperNodeDepsMap &SuperNodeDeps,
                    ElemToSuperNodeMap &ElemToSN) {
-      bool SuperNodeDepsChanged = false;
-
-      Deps.visit([&](ContainerId &Container, ElementSet &Elements) {
+      return Deps.visit([&](ContainerId &Container, ElementSet &Elements) {
         auto I = ElemToSN.find(Container);
         if (I == ElemToSN.end())
           return false;
@@ -294,15 +292,11 @@ template <typename ContainerIdT, typename ElementIdT> class WaitingOnGraph {
             return false;
 
           auto *DefSN = J->second;
-          if (DefSN != this) {
-            SuperNodeDepsChanged = true;
+          if (DefSN != this)
             SuperNodeDeps[DefSN].insert(this);
-          }
           return true;
         });
       });
-
-      return SuperNodeDepsChanged;
     }
   };
 


        


More information about the llvm-commits mailing list