Skip to content

Commit d8aa301

Browse files
committed
[5.6] Remove _move, _copy and disable passes/remove tests since we don't need it for 5.6.
These are still enabled on main, we just realized that they aren't necessary. That being said, we don't want to churn the tree by reverting the earlier commits from December. So we are leaving those in but deleting the tests and disabling the move passes.
1 parent 0190f06 commit d8aa301

19 files changed

+0
-2020
lines changed

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ static void addMandatoryDiagnosticOptPipeline(SILPassPipelinePlan &P) {
149149
P.addMandatoryInlining();
150150
P.addMandatorySILLinker();
151151

152-
// Before we promote any loads, perform _move checking for addresses.
153-
P.addMoveFunctionCanonicalization();
154-
P.addMoveKillsCopyableAddressesChecker();
155-
156152
// Promote loads as necessary to ensure we have enough SSA formation to emit
157153
// SSA based diagnostics.
158154
P.addPredictableMemoryAccessOptimizations();
@@ -173,11 +169,6 @@ static void addMandatoryDiagnosticOptPipeline(SILPassPipelinePlan &P) {
173169
// dead allocations.
174170
P.addPredictableDeadAllocationElimination();
175171

176-
// Now perform move semantic checking.
177-
P.addMoveKillsCopyableValuesChecker(); // No uses after _move of copyable
178-
// value.
179-
P.addMoveOnlyChecker(); // Check noImplicitCopy isn't copied.
180-
181172
// Now that we have finished performing diagnostics that rely on lexical
182173
// scopes, if lexical lifetimes are not enabled, eliminate lexical lfietimes.
183174
if (Options.LexicalLifetimes != LexicalLifetimesOption::On) {

stdlib/public/core/LifetimeManager.swift

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -165,61 +165,3 @@ extension String {
165165
return try _guts.withCString(body)
166166
}
167167
}
168-
169-
/// Takes in a value at +1 and performs a Builtin.move upon it.
170-
///
171-
/// IMPLEMENTATION NOTES: During transparent inlining, Builtin.move becomes the
172-
/// move_value instruction if we are inlining into a context where the
173-
/// specialized type is loadable. If the transparent function is called in a
174-
/// context where the inlined function specializes such that the specialized
175-
/// type is still not loadable, the compiler aborts (a). Once we have opaque
176-
/// values, this restriction will be lifted since after that address only types
177-
/// at SILGen time will be loadable objects.
178-
///
179-
/// (a). This is implemented by requiring that Builtin.move only be called
180-
/// within a function marked with the semantic tag "lifetimemanagement.move"
181-
/// which conveniently is only the function we are defining here: _move.
182-
///
183-
/// NOTE: We mark this _alwaysEmitIntoClient to ensure that we are not creating
184-
/// new ABI that the stdlib must maintain if a user calls this ignoring the '_'
185-
/// implying it is stdlib SPI.
186-
@_alwaysEmitIntoClient
187-
@inlinable
188-
@_transparent
189-
@_semantics("lifetimemanagement.move")
190-
public func _move<T>(_ value: __owned T) -> T {
191-
#if $BuiltinMove
192-
Builtin.move(value)
193-
#else
194-
value
195-
#endif
196-
}
197-
198-
/// Takes in a value at +0 and performs a Builtin.copy upon it.
199-
///
200-
/// IMPLEMENTATION NOTES: During transparent inlining, Builtin.copy becomes the
201-
/// explicit_copy_value instruction if we are inlining into a context where the
202-
/// specialized type is loadable. If the transparent function is called in a
203-
/// context where the inlined function specializes such that the specialized
204-
/// type is still not loadable, the compiler aborts (a). Once we have opaque
205-
/// values, this restriction will be lifted since after that address only types
206-
/// at SILGen time will be loadable objects.
207-
///
208-
/// (a). This is implemented by requiring that Builtin.copy only be called
209-
/// within a function marked with the semantic tag "lifetimemanagement.copy"
210-
/// which conveniently is only the function we are defining here: _copy.
211-
///
212-
/// NOTE: We mark this _alwaysEmitIntoClient to ensure that we are not creating
213-
/// new ABI that the stdlib must maintain if a user calls this ignoring the '_'
214-
/// implying it is stdlib SPI.
215-
@_alwaysEmitIntoClient
216-
@inlinable
217-
@_transparent
218-
@_semantics("lifetimemanagement.copy")
219-
public func _copy<T>(_ value: T) -> T {
220-
#if $BuiltinCopy
221-
Builtin.copy(value)
222-
#else
223-
value
224-
#endif
225-
}

test/Parse/noimplicitcopy_attr.swift

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

test/SIL/Parser/no_implicit_copy.sil

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

test/SILGen/copy_operator.swift

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

test/SILGen/copy_operator_generic_failure.swift

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

test/SILGen/moveonly_builtin.swift

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

test/SILGen/noimplicitcopy_attr.swift

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

test/SILGen/noimplicitcopy_attr_arg_generic_users_banned.swift

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

0 commit comments

Comments
 (0)