Skip to content

Commit 51e3e5e

Browse files
committed
Optimizer: rename BorrowArgumentsUpdater -> GuaranteedPhiUpdater
NFC
1 parent 68d0f61 commit 51e3e5e

File tree

19 files changed

+40
-40
lines changed

19 files changed

+40
-40
lines changed

SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ private func registerSwiftAnalyses() {
136136

137137
private func registerUtilities() {
138138
registerVerifier()
139-
registerBorrowArgumentsUpdater()
139+
registerGuaranteedPhiUpdater()
140140
}

SwiftCompilerSources/Sources/Optimizer/Utilities/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
swift_compiler_sources(Optimizer
1010
AccessUtilsTest.swift
1111
AddressUtils.swift
12-
BorrowArgumentsUpdater.swift
12+
GuaranteedPhiUpdater.swift
1313
BorrowUtils.swift
1414
SpecializationCloner.swift
1515
DiagnosticEngine.swift

SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowArgumentsUpdater.swift renamed to SwiftCompilerSources/Sources/Optimizer/Utilities/GuaranteedPhiUpdater.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- BorrowArgumentsUpdater.swift -------------------------------------===//
1+
//===--- GuaranteedPhiUpdater.swift ---------------------------------------===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -14,13 +14,13 @@ import SIL
1414
import OptimizerBridging
1515

1616
/// Updates the reborrow flags and the borrowed-from instructions for all guaranteed phis in `function`.
17-
func updateBorrowArguments(in function: Function, _ context: some MutatingContext) {
17+
func updateGuaranteedPhis(in function: Function, _ context: some MutatingContext) {
1818
updateReborrowFlags(in: function, context)
1919
updateBorrowedFrom(in: function, context)
2020
}
2121

2222
/// Updates the reborrow flags and the borrowed-from instructions for all `phis`.
23-
func updateBorrowArguments(for phis: some Sequence<Phi>, _ context: some MutatingContext) {
23+
func updateGuaranteedPhis(phis: some Sequence<Phi>, _ context: some MutatingContext) {
2424
updateReborrowFlags(for: phis, context)
2525
updateBorrowedFrom(for: phis, context)
2626
}
@@ -151,12 +151,12 @@ private func addEnclosingValues(
151151
return true
152152
}
153153

154-
func registerBorrowArgumentsUpdater() {
155-
BridgedUtilities.registerBorrowArgumentsUpdater(
154+
func registerGuaranteedPhiUpdater() {
155+
BridgedUtilities.registerGuaranteedPhiUpdater(
156156
{ (bridgedCtxt: BridgedPassContext, bridgedFunction: BridgedFunction) in
157157
let context = FunctionPassContext(_bridged: bridgedCtxt)
158158
let function = bridgedFunction.function;
159-
updateBorrowArguments(in: function, context)
159+
updateGuaranteedPhis(in: function, context)
160160
},
161161
{ (bridgedCtxt: BridgedPassContext, bridgedPhiArray: BridgedArrayRef) in
162162
let context = FunctionPassContext(_bridged: bridgedCtxt)
@@ -170,7 +170,7 @@ func registerBorrowArgumentsUpdater() {
170170
}
171171
}
172172
}
173-
updateBorrowArguments(for: guaranteedPhis, context)
173+
updateGuaranteedPhis(phis: guaranteedPhis, context)
174174
}
175175
)
176176
}

include/swift/SILOptimizer/OptimizerBridging.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ struct BridgedUtilities {
134134
typedef void (* _Nonnull UpdatePhisFn)(BridgedPassContext, BridgedArrayRef);
135135

136136
static void registerVerifier(VerifyFunctionFn verifyFunctionFn);
137-
static void registerBorrowArgumentsUpdater(UpdateFunctionFn updateBorrowedFromFn,
138-
UpdatePhisFn updateBorrowedFromPhisFn);
137+
static void registerGuaranteedPhiUpdater(UpdateFunctionFn updateBorrowedFromFn,
138+
UpdatePhisFn updateBorrowedFromPhisFn);
139139
};
140140

141141
struct BridgedBasicBlockSet {

include/swift/SILOptimizer/Utils/OwnershipOptUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,10 @@ bool extendStoreBorrow(StoreBorrowInst *sbi,
359359

360360
/// Updates the reborrow flags and the borrowed-from instructions for all
361361
/// guaranteed phis in function `f`.
362-
void updateAllBorrowArguments(SILPassManager *pm, SILFunction *f);
362+
void updateAllGuaranteedPhis(SILPassManager *pm, SILFunction *f);
363363

364364
/// Updates the reborrow flags and the borrowed-from instructions for all `phis`.
365-
void updateBorrowArguments(SILPassManager *pm, ArrayRef<SILPhiArgument *> phis);
365+
void updateGuaranteedPhis(SILPassManager *pm, ArrayRef<SILPhiArgument *> phis);
366366

367367
} // namespace swift
368368

lib/SILOptimizer/LoopTransforms/ArrayPropertyOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ class SwiftArrayPropertyOptPass : public SILFunctionTransform {
837837
if (getFunction()->getModule().getOptions().VerifyAll)
838838
getFunction()->verifyCriticalEdges();
839839

840-
updateAllBorrowArguments(getPassManager(), Fn);
840+
updateAllGuaranteedPhis(getPassManager(), Fn);
841841

842842
// We preserve the dominator tree. Let's invalidate everything
843843
// else.

lib/SILOptimizer/LoopTransforms/LoopRotate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ class LoopRotation : public SILFunctionTransform {
506506
}
507507

508508
if (changed) {
509-
updateAllBorrowArguments(PM, f);
509+
updateAllGuaranteedPhis(PM, f);
510510
// We preserve loop info and the dominator tree.
511511
domAnalysis->lockInvalidation();
512512
loopAnalysis->lockInvalidation();

lib/SILOptimizer/Mandatory/ClosureLifetimeFixup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ class ClosureLifetimeFixup : public SILFunctionTransform {
15291529
if (fixupClosureLifetimes(*getFunction(), dominanceAnalysis,
15301530
deadEndBlocksAnalysis, checkStackNesting,
15311531
modifiedCFG)) {
1532-
updateAllBorrowArguments(getPassManager(), getFunction());
1532+
updateAllGuaranteedPhis(getPassManager(), getFunction());
15331533
if (checkStackNesting){
15341534
modifiedCFG |=
15351535
StackNesting::fixNesting(getFunction()) == StackNesting::Changes::CFG;

lib/SILOptimizer/SILCombiner/SILCombine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ class SILCombine : public SILFunctionTransform {
620620
bool Changed = Combiner.runOnFunction(*getFunction());
621621

622622
if (Changed) {
623-
updateAllBorrowArguments(getPassManager(), getFunction());
623+
updateAllGuaranteedPhis(getPassManager(), getFunction());
624624
// Invalidate everything.
625625
invalidateAnalysis(SILAnalysis::InvalidationKind::FunctionBody);
626626
}

lib/SILOptimizer/SemanticARC/OwnedToGuaranteedPhiOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ bool swift::semanticarc::tryConvertOwnedPhisToGuaranteedPhis(Context &ctx) {
268268
}
269269

270270
if (madeChange)
271-
updateAllBorrowArguments(ctx.pm, &ctx.fn);
271+
updateAllGuaranteedPhis(ctx.pm, &ctx.fn);
272272

273273
return madeChange;
274274
}

0 commit comments

Comments
 (0)