Skip to content

Commit e256e04

Browse files
authored
Merge pull request #79316 from eeckstein/fix-spelling
Optimizer: fix spelling of the Simplifiable protocol
2 parents 7a7e6c2 + 3f95ce9 commit e256e04

35 files changed

+53
-53
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/SimplificationPasses.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ import SIL
1717
//===--------------------------------------------------------------------===//
1818

1919
/// Instructions which can be simplified at all optimization levels
20-
protocol Simplifyable : Instruction {
20+
protocol Simplifiable : Instruction {
2121
func simplify(_ context: SimplifyContext)
2222
}
2323

2424
/// Instructions which can be simplified at -Onone
25-
protocol OnoneSimplifyable : Simplifyable {
25+
protocol OnoneSimplifiable : Simplifiable {
2626
}
2727

2828
/// Instructions which can only be simplified at the end of the -Onone pipeline
29-
protocol LateOnoneSimplifyable : Instruction {
29+
protocol LateOnoneSimplifiable : Instruction {
3030
func simplifyLate(_ context: SimplifyContext)
3131
}
3232

@@ -38,7 +38,7 @@ let ononeSimplificationPass = FunctionPass(name: "onone-simplification") {
3838
(function: Function, context: FunctionPassContext) in
3939

4040
runSimplification(on: function, context, preserveDebugInfo: true) {
41-
if let i = $0 as? OnoneSimplifyable {
41+
if let i = $0 as? OnoneSimplifiable {
4242
i.simplify($1)
4343
}
4444
}
@@ -48,7 +48,7 @@ let simplificationPass = FunctionPass(name: "simplification") {
4848
(function: Function, context: FunctionPassContext) in
4949

5050
runSimplification(on: function, context, preserveDebugInfo: false) {
51-
if let i = $0 as? Simplifyable {
51+
if let i = $0 as? Simplifiable {
5252
i.simplify($1)
5353
}
5454
}
@@ -58,9 +58,9 @@ let lateOnoneSimplificationPass = FunctionPass(name: "late-onone-simplification"
5858
(function: Function, context: FunctionPassContext) in
5959

6060
runSimplification(on: function, context, preserveDebugInfo: true) {
61-
if let i = $0 as? LateOnoneSimplifyable {
61+
if let i = $0 as? LateOnoneSimplifiable {
6262
i.simplifyLate($1)
63-
} else if let i = $0 as? OnoneSimplifyable {
63+
} else if let i = $0 as? OnoneSimplifiable {
6464
i.simplify($1)
6565
}
6666
}

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyAllocRefDynamic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension AllocRefDynamicInst : OnoneSimplifyable {
15+
extension AllocRefDynamicInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
/// Optimize alloc_ref_dynamic of a known type to alloc_ref:
1818
///

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyApply.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension ApplyInst : OnoneSimplifyable {
15+
extension ApplyInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
if tryTransformThickToThinCallee(of: self, context) {
1818
return
@@ -25,13 +25,13 @@ extension ApplyInst : OnoneSimplifyable {
2525
}
2626
}
2727

28-
extension TryApplyInst : OnoneSimplifyable {
28+
extension TryApplyInst : OnoneSimplifiable {
2929
func simplify(_ context: SimplifyContext) {
3030
_ = context.tryDevirtualize(apply: self, isMandatory: false)
3131
}
3232
}
3333

34-
extension BeginApplyInst : OnoneSimplifyable {
34+
extension BeginApplyInst : OnoneSimplifiable {
3535
func simplify(_ context: SimplifyContext) {
3636
_ = context.tryDevirtualize(apply: self, isMandatory: false)
3737
}

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBeginAndLoadBorrow.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension BeginBorrowInst : OnoneSimplifyable, SILCombineSimplifyable {
15+
extension BeginBorrowInst : OnoneSimplifiable, SILCombineSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
if borrowedValue.ownership == .owned,
1818
// We need to keep lexical lifetimes in place.
@@ -27,7 +27,7 @@ extension BeginBorrowInst : OnoneSimplifyable, SILCombineSimplifyable {
2727
}
2828
}
2929

30-
extension LoadBorrowInst : Simplifyable, SILCombineSimplifyable {
30+
extension LoadBorrowInst : Simplifiable, SILCombineSimplifiable {
3131
func simplify(_ context: SimplifyContext) {
3232
if uses.ignoreDebugUses.ignoreUsers(ofType: EndBorrowInst.self).isEmpty {
3333
context.erase(instructionIncludingAllUsers: self)

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBeginCOWMutation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension BeginCOWMutationInst : Simplifyable, SILCombineSimplifyable {
15+
extension BeginCOWMutationInst : Simplifiable, SILCombineSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717

1818
/// The buffer of an empty Array/Set/Dictionary singleton is known to be not

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBranch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension BranchInst : OnoneSimplifyable {
15+
extension BranchInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
tryMergeWithTargetBlock(context)
1818
}

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBuiltin.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension BuiltinInst : OnoneSimplifyable {
15+
extension BuiltinInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
switch id {
1818
case .IsConcrete:
@@ -62,7 +62,7 @@ extension BuiltinInst : OnoneSimplifyable {
6262
}
6363
}
6464

65-
extension BuiltinInst : LateOnoneSimplifyable {
65+
extension BuiltinInst : LateOnoneSimplifiable {
6666
func simplifyLate(_ context: SimplifyContext) {
6767
if id == .IsConcrete {
6868
// At the end of the pipeline we can be sure that the isConcrete's type doesn't get "more" concrete.

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyCheckedCast.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension CheckedCastAddrBranchInst : OnoneSimplifyable {
15+
extension CheckedCastAddrBranchInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
guard let castWillSucceed = self.dynamicCastResult else {
1818
return

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyClassifyBridgeObject.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import AST
1414
import SIL
1515

16-
extension ClassifyBridgeObjectInst : OnoneSimplifyable, SILCombineSimplifyable {
16+
extension ClassifyBridgeObjectInst : OnoneSimplifiable, SILCombineSimplifiable {
1717
func simplify(_ context: SimplifyContext) {
1818
// Constant fold `classify_bridge_object` to `(false, false)` if the operand is known
1919
// to be a swift class.

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyCondBranch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension CondBranchInst : OnoneSimplifyable {
15+
extension CondBranchInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
tryConstantFold(context)
1818
}

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyCondFail.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension CondFailInst : OnoneSimplifyable {
15+
extension CondFailInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717

1818
/// Eliminates

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyConvertEscapeToNoEscape.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension ConvertEscapeToNoEscapeInst : OnoneSimplifyable {
15+
extension ConvertEscapeToNoEscapeInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
tryCombineWithThinToThickOperand(context)
1818
}

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyCopyValue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension CopyValueInst : OnoneSimplifyable, SILCombineSimplifyable {
15+
extension CopyValueInst : OnoneSimplifiable, SILCombineSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
if fromValue.ownership == .none {
1818
uses.replaceAll(with: fromValue, context)

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyDebugStep.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
import SIL
1414

15-
extension DebugStepInst : Simplifyable {
15+
extension DebugStepInst : Simplifiable {
1616
func simplify(_ context: SimplifyContext) {
17-
// When compiling with optimizations (note: it's not a OnoneSimplifyable transformation),
17+
// When compiling with optimizations (note: it's not a OnoneSimplifiable transformation),
1818
// unconditionally remove debug_step instructions.
1919
context.erase(instruction: self)
2020
}

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyDestroyValue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension DestroyValueInst : OnoneSimplifyable, SILCombineSimplifyable {
15+
extension DestroyValueInst : OnoneSimplifiable, SILCombineSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
if destroyedValue.ownership == .none {
1818
context.erase(instruction: self)

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyDestructure.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension DestructureTupleInst : OnoneSimplifyable, SILCombineSimplifyable {
15+
extension DestructureTupleInst : OnoneSimplifiable, SILCombineSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717

1818
// If the tuple is trivial, replace
@@ -56,7 +56,7 @@ extension DestructureTupleInst : OnoneSimplifyable, SILCombineSimplifyable {
5656
}
5757
}
5858

59-
extension DestructureStructInst : OnoneSimplifyable, SILCombineSimplifyable {
59+
extension DestructureStructInst : OnoneSimplifiable, SILCombineSimplifiable {
6060
func simplify(_ context: SimplifyContext) {
6161

6262
// If the struct is trivial, replace

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyFixLifetime.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import SIL
3030
/// operand).
3131
/// The benefit of this transformation is that it enables other optimizations, like mem2reg.
3232
///
33-
extension FixLifetimeInst : Simplifyable, SILCombineSimplifyable {
33+
extension FixLifetimeInst : Simplifiable, SILCombineSimplifiable {
3434
func simplify(_ context: SimplifyContext) {
3535
let opValue = operand.value
3636
guard opValue is AllocStackInst || opValue is StoreBorrowInst,

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyGlobalValue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import SIL
1818
// Note that `simplifyStrongRetainPass` and `simplifyStrongReleasePass` can
1919
// even remove "unbalanced" retains/releases of a `global_value`, but this
2020
// requires a minimum deployment target.
21-
extension GlobalValueInst : Simplifyable, SILCombineSimplifyable {
21+
extension GlobalValueInst : Simplifiable, SILCombineSimplifiable {
2222
func simplify(_ context: SimplifyContext) {
2323
var users = Stack<Instruction>(context)
2424
defer { users.deinitialize() }

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyInitEnumDataAddr.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension InitEnumDataAddrInst : OnoneSimplifyable {
15+
extension InitEnumDataAddrInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717

1818
// Optimize the sequence

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyKeyPath.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension KeyPathInst : OnoneSimplifyable {
15+
extension KeyPathInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
if allUsesRemovable(instruction: self) {
1818
if parentFunction.hasOwnership {

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyLoad.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension LoadInst : OnoneSimplifyable, SILCombineSimplifyable {
15+
extension LoadInst : OnoneSimplifiable, SILCombineSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
if optimizeLoadOfAddrUpcast(context) {
1818
return

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyMisc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension TypeValueInst: OnoneSimplifyable, SILCombineSimplifyable {
15+
extension TypeValueInst: OnoneSimplifiable, SILCombineSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
// If our parameter is not known statically, then bail.
1818
guard paramType.isInteger else {

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyPartialApply.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension PartialApplyInst : OnoneSimplifyable {
15+
extension PartialApplyInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
let optimizedApplyOfPartialApply = context.tryOptimizeApplyOfPartialApply(closure: self)
1818
if optimizedApplyOfPartialApply {

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyPointerToAddress.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension PointerToAddressInst : OnoneSimplifyable, SILCombineSimplifyable {
15+
extension PointerToAddressInst : OnoneSimplifiable, SILCombineSimplifiable {
1616

1717
func simplify(_ context: SimplifyContext) {
1818
if removeAddressToPointerToAddressPair(of: self, context) {

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyRefCasts.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212

1313
import SIL
1414

15-
// Note: this simplifications are not SILCombineSimplifyable, because SILCombine has
15+
// Note: this simplifications are not SILCombineSimplifiable, because SILCombine has
1616
// its own simplifications for those cast instructions which are not ported to Swift, yet.
1717

18-
extension CheckedCastBranchInst : OnoneSimplifyable {
18+
extension CheckedCastBranchInst : OnoneSimplifiable {
1919
func simplify(_ context: SimplifyContext) {
2020
// Has only an effect if the source is an (existential) reference.
2121
simplifySourceOperandOfRefCast(context)
2222
}
2323
}
2424

25-
extension UncheckedRefCastInst : OnoneSimplifyable {
25+
extension UncheckedRefCastInst : OnoneSimplifiable {
2626
func simplify(_ context: SimplifyContext) {
2727
simplifySourceOperandOfRefCast(context)
2828
}

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyRetainReleaseValue.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension RetainValueInst : Simplifyable, SILCombineSimplifyable {
15+
extension RetainValueInst : Simplifiable, SILCombineSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717

1818
// Remove pairs of
@@ -59,7 +59,7 @@ extension RetainValueInst : Simplifyable, SILCombineSimplifyable {
5959
}
6060
}
6161

62-
extension ReleaseValueInst : Simplifyable, SILCombineSimplifyable {
62+
extension ReleaseValueInst : Simplifiable, SILCombineSimplifiable {
6363
func simplify(_ context: SimplifyContext) {
6464

6565
// Replace

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyStrongRetainRelease.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension StrongRetainInst : Simplifyable, SILCombineSimplifyable {
15+
extension StrongRetainInst : Simplifiable, SILCombineSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
if isNotReferenceCounted(value: instance) {
1818
context.erase(instruction: self)
@@ -44,7 +44,7 @@ extension StrongRetainInst : Simplifyable, SILCombineSimplifyable {
4444
}
4545
}
4646

47-
extension StrongReleaseInst : Simplifyable, SILCombineSimplifyable {
47+
extension StrongReleaseInst : Simplifiable, SILCombineSimplifiable {
4848
func simplify(_ context: SimplifyContext) {
4949
let op = instance
5050
if isNotReferenceCounted(value: op) {

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyStructExtract.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension StructExtractInst : OnoneSimplifyable {
15+
extension StructExtractInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717
guard let structInst = self.struct as? StructInst else {
1818
return

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifySwitchEnum.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import SIL
2626
//
2727
// Other case blocks of the switch_enum become dead.
2828
//
29-
extension SwitchEnumInst : OnoneSimplifyable {
29+
extension SwitchEnumInst : OnoneSimplifiable {
3030
func simplify(_ context: SimplifyContext) {
3131
guard let enumInst = enumOp as? EnumInst,
3232
let caseBlock = getUniqueSuccessor(forCaseIndex: enumInst.caseIndex) else

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyTuple.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension TupleInst : OnoneSimplifyable {
15+
extension TupleInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717

1818
// Eliminate the redundant instruction pair

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyTupleExtract.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SIL
1414

15-
extension TupleExtractInst : OnoneSimplifyable {
15+
extension TupleExtractInst : OnoneSimplifiable {
1616
func simplify(_ context: SimplifyContext) {
1717

1818
// Replace tuple_extract(tuple(x)) -> x

0 commit comments

Comments
 (0)