[llvm] [DomTreeUpdater] Move critical edge splitting code to updater (PR #115111)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 18 11:31:47 PST 2024
================
@@ -250,12 +270,23 @@ void GenericDomTreeUpdater<DerivedT, DomTreeT,
return;
// Only apply updates not are applied by DomTree.
- if (hasPendingDomTreeUpdates()) {
- const auto I = PendUpdates.begin() + PendDTUpdateIndex;
+ while (hasPendingDomTreeUpdates()) {
+ auto I = PendUpdates.begin() + PendDTUpdateIndex;
const auto E = PendUpdates.end();
assert(I < E && "Iterator range invalid; there should be DomTree updates.");
- DT->applyUpdates(ArrayRef<typename DomTreeT::UpdateType>(I, E));
- PendDTUpdateIndex = PendUpdates.size();
+ if (!I->IsCriticalEdgeSplit) {
+ SmallVector<UpdateT, 32> NormalUpdates;
+ while (I != E && !I->IsCriticalEdgeSplit)
+ NormalUpdates.push_back((I++)->Update);
+ DT->applyUpdates(NormalUpdates);
+ PendDTUpdateIndex += NormalUpdates.size();
+ } else {
+ SmallVector<CriticalEdge, 32> CriticalEdges;
+ while (I != E && I->IsCriticalEdgeSplit)
+ CriticalEdges.push_back((I++)->EdgeSplit);
----------------
kuhar wrote:
Also here
https://github.com/llvm/llvm-project/pull/115111
More information about the llvm-commits
mailing list