aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2021-01-10 16:25:15 +0300
committerRoman Lebedev <lebedev.ri@gmail.com>2021-01-11 00:30:44 +0300
commit8e8d214c4a6c417e42996faeb9211a5c2e32111f (patch)
tree94e2c72c2c0e4c84b1323fe3b05cd84db86d8e32 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent13dea030b3d794d05a08dd0080c35844c9ca1b30 (diff)
downloadllvm-8e8d214c4a6c417e42996faeb9211a5c2e32111f.zip
llvm-8e8d214c4a6c417e42996faeb9211a5c2e32111f.tar.gz
llvm-8e8d214c4a6c417e42996faeb9211a5c2e32111f.tar.bz2
[NFCI][SimplifyCFG] Prefer to add Insert edges before Delete edges into DomTreeUpdater, if reasonable
This has a measurable impact on the number of DomTree recalculations. While this doesn't handle all the cases, it deals with the most obvious ones.
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/BasicBlockUtils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
index 0b3a259..bfad88f 100644
--- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -1395,11 +1395,11 @@ BasicBlock *llvm::CreateControlFlowHub(
SmallVector<DominatorTree::UpdateType, 16> Updates;
if (DTU) {
for (auto In : Incoming) {
+ Updates.push_back({DominatorTree::Insert, In, FirstGuardBlock});
for (auto Succ : successors(In)) {
if (Outgoing.count(Succ))
Updates.push_back({DominatorTree::Delete, In, Succ});
}
- Updates.push_back({DominatorTree::Insert, In, FirstGuardBlock});
}
}