[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.
This commit is contained in:
Lang Hames 2026-03-08 14:28:04 +11:00 committed by GitHub
parent a2231642b3
commit b883091bad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -280,9 +280,7 @@ public:
/// 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 @@ public:
return false;
auto *DefSN = J->second;
if (DefSN != this) {
SuperNodeDepsChanged = true;
if (DefSN != this)
SuperNodeDeps[DefSN].insert(this);
}
return true;
});
});
return SuperNodeDepsChanged;
}
};