Skip to content

Commit 3ce4fbf

Browse files
committed
Let the ComputeDominanceInfo pass also compute post-dominance info.
And use this in the recently added test.
1 parent 3b30fb4 commit 3ce4fbf

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

include/swift/SILOptimizer/PassManager/Passes.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ PASS(ClosureSpecializer, "closure-specialize",
5858
PASS(CodeSinking, "code-sinking",
5959
"Sinks code closer to users")
6060
PASS(ComputeDominanceInfo, "compute-dominance-info",
61-
"Utility pass that computes dominance info for all functions in order to "
62-
"help test dominanceinfo updating")
61+
"Utility pass that computes (post-)dominance info for all functions in "
62+
"order to help test dominanceinfo updating")
6363
PASS(ComputeLoopInfo, "compute-loop-info",
6464
"Utility pass that computes loop info for all functions in order to help "
6565
"test loop info updating")

lib/SILOptimizer/UtilityPasses/ComputeDominanceInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class ComputeDominanceInfo : public SILFunctionTransform {
2121

2222
void run() override {
2323
PM->getAnalysis<DominanceAnalysis>()->get(getFunction());
24+
PM->getAnalysis<PostDominanceAnalysis>()->get(getFunction());
2425
}
2526

2627
StringRef getName() override { return "Compute Dominance Info"; }

test/SILOptimizer/postdomtree_verification_crash.sil

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// RUN: %target-sil-opt -enable-sil-verify-all -sil-verify-without-invalidation %s -stack-promotion
1+
// RUN: %target-sil-opt -enable-sil-verify-all -sil-verify-without-invalidation %s -compute-dominance-info
22

33
// Check if post-dominator verification does not crash on multiple roots.
4-
// We run stack promotion because it requests the post-dominator analysis.
54

65
sil_stage canonical
76

0 commit comments

Comments
 (0)