Skip to content

Commit 3038853

Browse files
committed
SemanticARCOpts: remove the BorrowScope optimization because this is now covered by SimplifyBeginBorrow
1 parent a624d75 commit 3038853

File tree

8 files changed

+3
-79
lines changed

8 files changed

+3
-79
lines changed

lib/SILOptimizer/SemanticARC/BorrowScopeOpts.cpp

Lines changed: 0 additions & 68 deletions
This file was deleted.

lib/SILOptimizer/SemanticARC/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
target_sources(swiftSILOptimizer PRIVATE
22
SemanticARCOpts.cpp
33
OwnershipLiveRange.cpp
4-
BorrowScopeOpts.cpp
54
CopyValueOpts.cpp
65
OwnedToGuaranteedPhiOpt.cpp
76
Context.cpp

lib/SILOptimizer/SemanticARC/SemanticARCOptVisitor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ struct LLVM_LIBRARY_VISIBILITY SemanticARCOptVisitor
142142
}
143143

144144
bool visitCopyValueInst(CopyValueInst *cvi);
145-
bool visitBeginBorrowInst(BeginBorrowInst *bbi);
146145
bool visitMoveValueInst(MoveValueInst *mvi);
147146
bool
148147
visitUncheckedOwnershipConversionInst(UncheckedOwnershipConversionInst *uoci);

lib/SILOptimizer/SemanticARC/SemanticARCOpts.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ static llvm::cl::list<ARCTransformKind> TransformsToPerform(
3636
clEnumValN(ARCTransformKind::LoadCopyToLoadBorrowPeephole,
3737
"sil-semantic-arc-peepholes-loadcopy-to-loadborrow",
3838
"Perform the load [copy] to load_borrow peephole"),
39-
clEnumValN(ARCTransformKind::RedundantBorrowScopeElimPeephole,
40-
"sil-semantic-arc-peepholes-redundant-borrowscope-elim",
41-
"Perform the redundant borrow scope elimination peephole"),
4239
clEnumValN(ARCTransformKind::RedundantCopyValueElimPeephole,
4340
"sil-semantic-arc-peepholes-redundant-copyvalue-elim",
4441
"Perform the redundant copy_value peephole"),
@@ -87,7 +84,6 @@ struct SemanticARCOpts : SILFunctionTransform {
8784
switch (transform) {
8885
case ARCTransformKind::LifetimeJoiningPeephole:
8986
case ARCTransformKind::RedundantCopyValueElimPeephole:
90-
case ARCTransformKind::RedundantBorrowScopeElimPeephole:
9187
case ARCTransformKind::LoadCopyToLoadBorrowPeephole:
9288
case ARCTransformKind::AllPeepholes:
9389
case ARCTransformKind::OwnershipConversionElimPeephole:

lib/SILOptimizer/SemanticARC/SemanticARCOpts.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ enum class ARCTransformKind : uint64_t {
2525
Invalid = 0,
2626
OwnedToGuaranteedPhi = 0x1,
2727
LoadCopyToLoadBorrowPeephole = 0x2,
28-
RedundantBorrowScopeElimPeephole = 0x4,
2928
// TODO: Split RedundantCopyValueElimPeephole into more granular categories
3029
// such as dead live range, guaranteed copy_value opt, etc.
3130
RedundantCopyValueElimPeephole = 0x8,
@@ -34,7 +33,6 @@ enum class ARCTransformKind : uint64_t {
3433
RedundantMoveValueElim = 0x40,
3534

3635
AllPeepholes = LoadCopyToLoadBorrowPeephole |
37-
RedundantBorrowScopeElimPeephole |
3836
RedundantCopyValueElimPeephole | LifetimeJoiningPeephole |
3937
OwnershipConversionElimPeephole,
4038
All = AllPeepholes | OwnedToGuaranteedPhi | RedundantMoveValueElim,

test/ClangImporter/serialization-sil.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -enable-copy-propagation=requested-passes-only -enable-lexical-lifetimes=false -Xllvm -sil-disable-pass=Simplification -emit-module-path %t/Test.swiftmodule -Xllvm -sil-print-types -emit-sil -o /dev/null -module-name Test %s -sdk "" -import-objc-header %S/Inputs/serialization-sil.h
2+
// RUN: %target-swift-frontend -enable-copy-propagation=requested-passes-only -enable-lexical-lifetimes=false -Xllvm -simplify-instruction=begin_borrow -emit-module-path %t/Test.swiftmodule -Xllvm -sil-print-types -emit-sil -o /dev/null -module-name Test %s -sdk "" -import-objc-header %S/Inputs/serialization-sil.h
33
// RUN: %target-sil-func-extractor -sil-print-types %t/Test.swiftmodule -sil-print-debuginfo -func='$s4Test16testPartialApplyyySoAA_pF' -o - | %FileCheck %s
44

55
// REQUIRES: objc_interop

test/SILOptimizer/semantic-arc-opts-canonical.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -sil-print-types -module-name Swift -enable-sil-verify-all -semantic-arc-opts %s | %FileCheck %s
1+
// RUN: %target-sil-opt -sil-print-types -module-name Swift -enable-sil-verify-all -semantic-arc-opts -onone-simplification -simplify-instruction=begin_borrow %s | %FileCheck %s
22

33
// REQUIRES: swift_in_compiler
44

test/SILOptimizer/semantic-arc-opts.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -sil-print-types -module-name Swift -enable-sil-verify-all -semantic-arc-opts %s | %FileCheck %s
1+
// RUN: %target-sil-opt -sil-print-types -module-name Swift -enable-sil-verify-all -semantic-arc-opts -onone-simplification -simplify-instruction=begin_borrow %s | %FileCheck %s
22

33
sil_stage raw
44

0 commit comments

Comments
 (0)