Skip to content

Commit 4f73008

Browse files
committed
PassPipeline: add a few utility passes in the low-level pipeline
To be able to remove lazy initialization of global read-only arrays
1 parent af5037a commit 4f73008

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,9 @@ static void addLowLevelPassPipeline(SILPassPipelinePlan &P) {
810810
P.addDeadObjectElimination();
811811
P.addObjectOutliner();
812812
P.addDeadStoreElimination();
813+
P.addDCE();
814+
P.addSimplification();
815+
P.addInitializeStaticGlobals();
813816

814817
// dead-store-elimination can expose opportunities for dead object elimination.
815818
P.addDeadObjectElimination();

test/SILOptimizer/devirt_covariant_return.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public class D2: D1 {
235235
// that D2.foo() is inlined thanks to this.
236236
// CHECK-LABEL: sil hidden [noinline] @$s23devirt_covariant_return7driver2ys5Int32VAA2D2CF
237237
// CHECK-NOT: class_method
238-
// CHECK: checked_cast_br [exact] D1 in %{{.*}} : $D1 to D2
238+
// CHECK: checked_cast_br [exact] D1 in
239239
// CHECK: bb2
240240
// CHECK: global_addr
241241
// CHECK: load

0 commit comments

Comments
 (0)