[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:46 PST 2024
================
@@ -267,19 +298,30 @@ void GenericDomTreeUpdater<DerivedT, DomTreeT,
return;
// Only apply updates not are applied by PostDomTree.
- if (hasPendingPostDomTreeUpdates()) {
- const auto I = PendUpdates.begin() + PendPDTUpdateIndex;
+ while (hasPendingPostDomTreeUpdates()) {
+ auto I = PendUpdates.begin() + PendPDTUpdateIndex;
const auto E = PendUpdates.end();
assert(I < E &&
"Iterator range invalid; there should be PostDomTree updates.");
- PDT->applyUpdates(ArrayRef<typename DomTreeT::UpdateType>(I, E));
- PendPDTUpdateIndex = PendUpdates.size();
+ if (!I->IsCriticalEdgeSplit) {
+ SmallVector<UpdateT, 32> NormalUpdates;
+ while (I != E && !I->IsCriticalEdgeSplit)
+ NormalUpdates.push_back((I++)->Update);
+ PDT->applyUpdates(NormalUpdates);
+ PendPDTUpdateIndex += 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