Skip to content

Commit d25b1ed

Browse files
committed
Optimizer: Replace the MandatoryCombine pass with a Simplification pass, which is implemented in Swift
The Swift Simplification pass can do more than the old MandatoryCombine pass: simplification of more instruction types and dead code elimination. The result is a better -Onone performance while still keeping debug info consistent. Currently following code patterns are simplified: * `struct` -> `struct_extract` * `enum` -> `unchecked_enum_data` * `partial_apply` -> `apply` * `br` to a 1:1 related block * `cond_br` with a constant condition * `isConcrete` and `is_same_metadata` builtins More simplifications can be added in the future. rdar://96708429 rdar://104562580
1 parent 85210a4 commit d25b1ed

File tree

60 files changed

+164
-546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+164
-546
lines changed

include/swift/SILOptimizer/PassManager/Passes.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,6 @@ PASS(YieldOnceCheck, "yield-once-check",
434434
PASS(OSLogOptimization, "os-log-optimization", "Optimize os log calls")
435435
PASS(ForEachLoopUnroll, "for-each-loop-unroll",
436436
"Unroll forEach loops over array literals")
437-
PASS(MandatoryCombine, "mandatory-combine",
438-
"Perform mandatory peephole combines")
439-
PASS(OptimizedMandatoryCombine, "optimized-mandatory-combine",
440-
"Perform -O level mandatory peephole combines")
441437
PASS(BugReducerTester, "bug-reducer-tester",
442438
"sil-bug-reducer Tool Testing by Asserting on a Sentinel Function")
443439
PASS(AssemblyVisionRemarkGenerator, "assembly-vision-remark-generator",

lib/SILOptimizer/Mandatory/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ target_sources(swiftSILOptimizer PRIVATE
3838
RawSILInstLowering.cpp
3939
SILGenCleanup.cpp
4040
YieldOnceCheck.cpp
41-
MandatoryCombine.cpp
4241
OSLogOptimization.cpp
4342
MoveOnlyWrappedTypeEliminator.cpp
4443
OwnershipModelEliminator.cpp)

0 commit comments

Comments
 (0)