Skip to content

Commit e1c65bd

Browse files
committed
Swift Optimizer: rename the ComputeEffects pass to ComputeEscapeEffects
1 parent 66f07fe commit e1c65bd

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/CMakeLists.txt

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

99
swift_compiler_sources(Optimizer
1010
AssumeSingleThreaded.swift
11-
ComputeEffects.swift
11+
ComputeEscapeEffects.swift
1212
ObjCBridgingOptimization.swift
1313
MergeCondFails.swift
1414
ReleaseDevirtualizer.swift

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeEffects.swift renamed to SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeEscapeEffects.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- ComputeEffects.swift - Compute function effects ------------------===//
1+
//===--- ComputeEscapeEffects.swift ----------------------------------------==//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -25,7 +25,7 @@ import SIL
2525
/// ```
2626
/// The pass does not try to change or re-compute _defined_ effects.
2727
///
28-
let computeEffects = FunctionPass(name: "compute-effects", {
28+
let computeEscapeEffects = FunctionPass(name: "compute-escape-effects", {
2929
(function: Function, context: PassContext) in
3030

3131
var newEffects = Stack<EscapeEffects.ArgumentEffect>(context)

SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private func registerSwiftPasses() {
5151

5252
// Function passes
5353
registerPass(mergeCondFailsPass, { mergeCondFailsPass.run($0) })
54-
registerPass(computeEffects, { computeEffects.run($0) })
54+
registerPass(computeEscapeEffects, { computeEscapeEffects.run($0) })
5555
registerPass(objCBridgingOptimization, { objCBridgingOptimization.run($0) })
5656
registerPass(stackPromotion, { stackPromotion.run($0) })
5757
registerPass(functionStackProtection, { functionStackProtection.run($0) })

include/swift/SILOptimizer/PassManager/Passes.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ SWIFT_FUNCTION_PASS(AddressEscapeInfoDumper, "dump-addr-escape-info",
243243
"Dumps address escape information")
244244
SWIFT_FUNCTION_PASS(AccessDumper, "dump-access",
245245
"Dump access information")
246-
SWIFT_FUNCTION_PASS(ComputeEffects, "compute-effects",
247-
"Computes function effects")
246+
SWIFT_FUNCTION_PASS(ComputeEscapeEffects, "compute-escape-effects",
247+
"Computes function escape effects")
248248
PASS(FlowIsolation, "flow-isolation",
249249
"Enforces flow-sensitive actor isolation rules")
250250
PASS(FunctionOrderPrinter, "function-order-printer",

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ static void addHighLevelFunctionPipeline(SILPassPipelinePlan &P) {
638638
addHighLevelLoopOptPasses(P);
639639

640640
P.addStringOptimization();
641-
P.addComputeEffects();
641+
P.addComputeEscapeEffects();
642642
}
643643

644644
// After "high-level" function passes have processed the entire call tree, run
@@ -653,7 +653,7 @@ static void addHighLevelModulePipeline(SILPassPipelinePlan &P) {
653653
// Do the first stack promotion on high-level SIL before serialization.
654654
//
655655
// FIXME: why does StackPromotion need to run in the module pipeline?
656-
P.addComputeEffects();
656+
P.addComputeEscapeEffects();
657657
P.addStackPromotion();
658658

659659
P.addGlobalOpt();
@@ -694,7 +694,7 @@ static void addClosureSpecializePassPipeline(SILPassPipelinePlan &P) {
694694

695695
// ComputeEffects should be done at the end of a function-pipeline. The next
696696
// pass (GlobalOpt) is a module pass, so this is the end of a function-pipeline.
697-
P.addComputeEffects();
697+
P.addComputeEscapeEffects();
698698

699699
// Hoist globals out of loops.
700700
// Global-init functions should not be inlined GlobalOpt is done.
@@ -725,7 +725,7 @@ static void addClosureSpecializePassPipeline(SILPassPipelinePlan &P) {
725725
// passes can expose more inlining opportunities.
726726
addSimplifyCFGSILCombinePasses(P);
727727

728-
P.addComputeEffects();
728+
P.addComputeEscapeEffects();
729729

730730
// We do this late since it is a pass like the inline caches that we only want
731731
// to run once very late. Make sure to run at least one round of the ARC
@@ -746,7 +746,7 @@ static void addLowLevelPassPipeline(SILPassPipelinePlan &P) {
746746

747747
// We've done a lot of optimizations on this function, attempt to FSO.
748748
P.addFunctionSignatureOpts();
749-
P.addComputeEffects();
749+
P.addComputeEscapeEffects();
750750
}
751751

752752
static void addLateLoopOptPassPipeline(SILPassPipelinePlan &P) {
@@ -775,7 +775,7 @@ static void addLateLoopOptPassPipeline(SILPassPipelinePlan &P) {
775775

776776
// Sometimes stack promotion can catch cases only at this late stage of the
777777
// pipeline, after FunctionSignatureOpts.
778-
P.addComputeEffects();
778+
P.addComputeEscapeEffects();
779779
P.addStackPromotion();
780780

781781
// Optimize overflow checks.

test/SILOptimizer/function_effects.sil renamed to test/SILOptimizer/escape_effects.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt %s -compute-effects | %FileCheck %s
1+
// RUN: %target-sil-opt %s -compute-escape-effects | %FileCheck %s
22

33
// REQUIRES: swift_in_compiler
44

test/SILOptimizer/function_effects_objc.sil renamed to test/SILOptimizer/escape_effects_objc.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt %s -compute-effects | %FileCheck %s
1+
// RUN: %target-sil-opt %s -compute-escape-effects | %FileCheck %s
22

33
// REQUIRES: swift_in_compiler
44
// REQUIRES: objc_interop

test/SILOptimizer/stack_promotion.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -compute-effects -stack-promotion -enable-sil-verify-all %s | %FileCheck %s
1+
// RUN: %target-sil-opt -compute-escape-effects -stack-promotion -enable-sil-verify-all %s | %FileCheck %s
22

33
// REQUIRES: swift_in_compiler
44

0 commit comments

Comments
 (0)