Skip to content

[stdlib] Collection types are eagerMove. #64553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,14 @@ private func removeBridgingCodeInPredecessors(of block: BasicBlock, _ context: F
}

private func lookThroughOwnershipInsts(_ value: Value) -> Value {
// Looks like it's sufficient to support begin_borrow for now.
// TODO: add copy_value if needed.
// Looks like it's sufficient to support begin_borrow and copy_value for now.
// TODO: add move_value if needed.
if let bbi = value as? BeginBorrowInst {
return bbi.borrowedValue
}
if let cvi = value as? CopyValueInst {
return cvi.fromValue
}
return value
}

Expand Down
20 changes: 10 additions & 10 deletions lib/SIL/IR/TypeLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2758,16 +2758,16 @@ bool TypeConverter::visitAggregateLeaves(
packIndex);
}
} else if (auto tupleTy = ty->getAs<TupleType>()) {
for (unsigned tupleIndex = 0, num = tupleTy->getNumElements();
tupleIndex < num; ++tupleIndex) {
auto origElementTy = origTy.getTupleElementType(tupleIndex);
auto substElementTy =
tupleTy->getElementType(tupleIndex)->getCanonicalType();
substElementTy =
computeLoweredRValueType(context, origElementTy, substElementTy);
insertIntoWorklist(substElementTy, origElementTy, nullptr,
tupleIndex);
}
unsigned tupleIndex = 0;
origTy.forEachExpandedTupleElement(
CanTupleType(tupleTy),
[&](auto origElementTy, auto substElementTy, auto element) {
substElementTy =
substOpaqueTypesWithUnderlyingTypes(substElementTy, context);
insertIntoWorklist(substElementTy, origElementTy, nullptr,
tupleIndex);
++tupleIndex;
});
} else if (auto *decl = ty->getStructOrBoundGenericStruct()) {
for (auto *structField : decl->getStoredProperties()) {
auto subMap = ty->getContextSubstitutionMap(&M, decl);
Expand Down
1 change: 1 addition & 0 deletions stdlib/public/core/Array.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@
/// instances of those types always have a contiguous block of memory as
/// their storage.
@frozen
@_eagerMove
public struct Array<Element>: _DestructorSafeContainer {
#if _runtime(_ObjC)
@usableFromInline
Expand Down
1 change: 1 addition & 0 deletions stdlib/public/core/ContiguousArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
/// For more information about using arrays, see `Array` and `ArraySlice`, with
/// which `ContiguousArray` shares most properties and methods.
@frozen
@_eagerMove
public struct ContiguousArray<Element>: _DestructorSafeContainer {
@usableFromInline
internal typealias _Buffer = _ContiguousArrayBuffer<Element>
Expand Down
1 change: 1 addition & 0 deletions stdlib/public/core/Dictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@
/// optimization that is used when two instances of `Dictionary` share
/// buffer.
@frozen
@_eagerMove
public struct Dictionary<Key: Hashable, Value> {
/// The element type of a dictionary: a tuple containing an individual
/// key-value pair.
Expand Down
1 change: 1 addition & 0 deletions stdlib/public/core/Set.swift
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
/// same copy-on-write optimization that is used when two instances of `Set`
/// share buffer.
@frozen
@_eagerMove
public struct Set<Element: Hashable> {
@usableFromInline
internal var _variant: _Variant
Expand Down
1 change: 1 addition & 0 deletions stdlib/public/core/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ internal func unimplemented_utf8_32bit(
/// [scalars]: http://www.unicode.org/glossary/#unicode_scalar_value
/// [equivalence]: http://www.unicode.org/glossary/#canonical_equivalent
@frozen
@_eagerMove
public struct String {
public // @SPI(Foundation)
var _guts: _StringGuts
Expand Down
16 changes: 8 additions & 8 deletions test/AutoDiff/SILOptimizer/activity_analysis.swift
Original file line number Diff line number Diff line change
Expand Up @@ -350,26 +350,26 @@ func testArrayUninitializedIntrinsicNested(_ x: Float, _ y: Float) -> [Float] {
// CHECK: [ACTIVE] [[ARRAY:%.*]] = apply %14<Float>(%7) : $@convention(thin) <τ_0_0> (@owned Array<τ_0_0>) -> @owned Array<τ_0_0>
// CHECK: [USEFUL] [[INT_LIT:%.*]] = integer_literal $Builtin.Word, 2
// CHECK: [NONE] // function_ref _allocateUninitializedArray<A>(_:)
// CHECK: [ACTIVE] [[TUP:%.*]] = apply %19<Float>([[INT_LIT]]) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer)
// CHECK: [ACTIVE] [[TUP:%.*]] = apply %18<Float>([[INT_LIT]]) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer)
// CHECK: [ACTIVE] (**[[LHS:%.*]]**, [[RHS:%.*]]) = destructure_tuple [[TUP]] : $(Array<Float>, Builtin.RawPointer)
// CHECK: [VARIED] ([[LHS]], **[[RHS]]**) = destructure_tuple [[TUP]] : $(Array<Float>, Builtin.RawPointer)
// CHECK: [ACTIVE] [[FLOAT_PTR:%.*]] = pointer_to_address [[RHS]] : $Builtin.RawPointer to [strict] $*Float
// CHECK: [USEFUL] [[ZERO_LITERAL:%.*]] = integer_literal $Builtin.IntLiteral, 0
// CHECK: [USEFUL] [[META:%.*]] = metatype $@thin Int.Type
// CHECK: [NONE] // function_ref Int.init(_builtinIntegerLiteral:)
// CHECK: [USEFUL] [[RESULT_2:%.*]] = apply %26([[ZERO_LITERAL]], [[META]]) : $@convention(method) (Builtin.IntLiteral, @thin Int.Type) -> Int
// CHECK: [USEFUL] [[RESULT_2:%.*]] = apply %25([[ZERO_LITERAL]], [[META]]) : $@convention(method) (Builtin.IntLiteral, @thin Int.Type) -> Int
// CHECK: [NONE] // function_ref Array.subscript.getter
// CHECK: [NONE] %29 = apply %28<Float>([[FLOAT_PTR]], [[RESULT_2]], %16) : $@convention(method) <τ_0_0> (Int, @guaranteed Array<τ_0_0>) -> @out τ_0_0
// CHECK: [NONE] %28 = apply %27<Float>([[FLOAT_PTR]], [[RESULT_2]], %15) : $@convention(method) <τ_0_0> (Int, @guaranteed Array<τ_0_0>) -> @out τ_0_0
// CHECK: [VARIED] [[ONE_LITERAL:%.*]] = integer_literal $Builtin.Word, 1
// CHECK: [ACTIVE] [[INDEX_ADDR:%.*]] = index_addr [[FLOAT_PTR]] : $*Float, [[ONE_LITERAL]] : $Builtin.Word
// CHECK: [USEFUL] [[ONE_LITERAL_AGAIN:%.*]] = integer_literal $Builtin.IntLiteral, 1
// CHECK: [USEFUL] [[META_AGAIN:%.*]] = metatype $@thin Int.Type
// CHECK: [NONE] // function_ref Int.init(_builtinIntegerLiteral:)
// CHECK: [USEFUL] %35 = apply %34([[ONE_LITERAL_AGAIN]], [[META_AGAIN]]) : $@convention(method) (Builtin.IntLiteral, @thin Int.Type) -> Int
// CHECK: [USEFUL] %34 = apply %33([[ONE_LITERAL_AGAIN]], [[META_AGAIN]]) : $@convention(method) (Builtin.IntLiteral, @thin Int.Type) -> Int
// CHECK: [NONE] // function_ref Array.subscript.getter
// CHECK: [NONE] %37 = apply %36<Float>(%31, %35, %16) : $@convention(method) <τ_0_0> (Int, @guaranteed Array<τ_0_0>) -> @out τ_0_0
// CHECK: [NONE] %36 = apply %35<Float>(%30, %34, %15) : $@convention(method) <τ_0_0> (Int, @guaranteed Array<τ_0_0>) -> @out τ_0_0
// CHECK: [NONE] // function_ref _finalizeUninitializedArray<A>(_:)
// CHECK: [ACTIVE] %39 = apply %38<Float>(%21) : $@convention(thin) <τ_0_0> (@owned Array<τ_0_0>) -> @owned Array<τ_0_0>
// CHECK: [ACTIVE] %38 = apply %37<Float>(%20) : $@convention(thin) <τ_0_0> (@owned Array<τ_0_0>) -> @owned Array<τ_0_0>

// TF-978: Test array literal initialized with `apply` indirect results.
struct Wrapper<T: Differentiable>: Differentiable {
Expand Down Expand Up @@ -617,7 +617,7 @@ func testBeginApplyActiveInoutArgument(array: [Float], x: Float) -> Float {
// CHECK-LABEL: [AD] Activity info for ${{.*}}testBeginApplyActiveInoutArgument{{.*}} at parameter indices (0, 1) and result indices (0)
// CHECK: [ACTIVE] %0 = argument of bb0 : $Array<Float>
// CHECK: [ACTIVE] %1 = argument of bb0 : $Float
// CHECK: [ACTIVE] %4 = alloc_stack [lexical] $Array<Float>, var, name "array"
// CHECK: [ACTIVE] %4 = alloc_stack $Array<Float>, var, name "array"
// CHECK: [ACTIVE] %5 = copy_value %0 : $Array<Float>
// CHECK: [USEFUL] %7 = integer_literal $Builtin.IntLiteral, 0
// CHECK: [USEFUL] %8 = metatype $@thin Int.Type
Expand Down Expand Up @@ -654,7 +654,7 @@ func testBeginApplyActiveButInitiallyNonactiveInoutArgument(x: Float) -> Float {

// CHECK-LABEL: [AD] Activity info for ${{.*}}testBeginApplyActiveButInitiallyNonactiveInoutArgument{{.*}} at parameter indices (0) and result indices (0)
// CHECK: [ACTIVE] %0 = argument of bb0 : $Float
// CHECK: [ACTIVE] %2 = alloc_stack [lexical] $Array<Float>, var, name "array"
// CHECK: [ACTIVE] %2 = alloc_stack $Array<Float>, var, name "array"
// CHECK: [USEFUL] %3 = integer_literal $Builtin.Word, 1
// CHECK: [NONE] // function_ref _allocateUninitializedArray<A>(_:)
// CHECK: [USEFUL] %5 = apply %4<Float>(%3) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ func modify(_ s: Struct, _ x: Float) -> Float {
func tupleArrayLiteralInitialization(_ x: Float, _ y: Float) -> Float {
// `Array<(Float, Float)>` does not conform to `Differentiable`.
let array = [(x * y, x * y)]
// expected-note @-1 {{cannot differentiate through a non-differentiable argument; do you want to use 'withoutDerivative(at:)'?}} {{7-7=withoutDerivative(at: }} {{12-12=)}}
// expected-note @-1 {{cannot differentiate through a non-differentiable argument; do you want to use 'withoutDerivative(at:)'?}} {{15-15=withoutDerivative(at: }} {{31-31=)}}
return array[0].0
}

Expand Down
10 changes: 4 additions & 6 deletions test/SILGen/consuming_parameter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ func bar(_: String) {}
func foo(y: consuming String, z: String) -> () -> String {
// CHECK: bb0(%0 : @owned $String, %1 : @guaranteed $String):
// CHECK: [[BOX:%.*]] = alloc_box ${ var String }
// CHECK: [[BOX1:%.*]] = begin_borrow [lexical] [[BOX]]
// CHECK: [[Y:%.*]] = project_box [[BOX1]]
// CHECK: [[Y:%.*]] = project_box [[BOX]]
// CHECK: store %0 to [init] [[Y]]

// CHECK: [[YCAPTURE:%.*]] = copy_value [[BOX1]]
// CHECK: [[YCAPTURE:%.*]] = copy_value [[BOX]]
// CHECK: partial_apply {{.*}} {{%.*}}([[YCAPTURE]])
let r = { y }

Expand All @@ -36,11 +35,10 @@ struct Butt {
consuming func merged(with other: Butt) -> () -> Butt {
// CHECK: bb0(%0 : @guaranteed $Butt, %1 : @owned $Butt):
// CHECK: [[BOX:%.*]] = alloc_box ${ var Butt }
// CHECK: [[BOX1:%.*]] = begin_borrow [lexical] [[BOX]]
// CHECK: [[SELF:%.*]] = project_box [[BOX1]]
// CHECK: [[SELF:%.*]] = project_box [[BOX]]
// CHECK: store %1 to [init] [[SELF]]

// CHECK: [[SELFCAPTURE:%.*]] = copy_value [[BOX1]]
// CHECK: [[SELFCAPTURE:%.*]] = copy_value [[BOX]]
// CHECK: partial_apply {{.*}} {{%.*}}([[SELFCAPTURE]])
let r = { self }

Expand Down
16 changes: 4 additions & 12 deletions test/SILGen/foreach.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ protocol GenericCollection : Collection {
// CHECK-LABEL: sil hidden [ossa] @$s7foreach13trivialStructyySaySiGF : $@convention(thin) (@guaranteed Array<Int>) -> () {
// CHECK: bb0([[ARRAY:%.*]] : @guaranteed $Array<Int>):
// CHECK: [[ITERATOR_BOX:%.*]] = alloc_box ${ var IndexingIterator<Array<Int>> }, var, name "$x$generator"
// CHECK: [[ITERATOR_LIFETIME:%[^,]+]] = begin_borrow [lexical] [[ITERATOR_BOX]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_LIFETIME]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_BOX]]
// CHECK: br [[LOOP_DEST:bb[0-9]+]]
//
// CHECK: [[LOOP_DEST]]:
Expand All @@ -66,7 +65,6 @@ protocol GenericCollection : Collection {
// CHECK: br [[LOOP_DEST]]
//
// CHECK: [[NONE_BB]]:
// CHECK: end_borrow [[ITERATOR_LIFETIME]]
// CHECK: destroy_value [[ITERATOR_BOX]]
// CHECK: [[FUNC_END_FUNC:%.*]] = function_ref @funcEnd : $@convention(thin) () -> ()
// CHECK: apply [[FUNC_END_FUNC]]()
Expand Down Expand Up @@ -107,8 +105,7 @@ func trivialStructBreak(_ xx: [Int]) {
// CHECK-LABEL: sil hidden [ossa] @$s7foreach26trivialStructContinueBreakyySaySiGF : $@convention(thin) (@guaranteed Array<Int>) -> () {
// CHECK: bb0([[ARRAY:%.*]] : @guaranteed $Array<Int>):
// CHECK: [[ITERATOR_BOX:%.*]] = alloc_box ${ var IndexingIterator<Array<Int>> }, var, name "$x$generator"
// CHECK: [[ITERATOR_LIFETIME:%[^,]+]] = begin_borrow [lexical] [[ITERATOR_BOX]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_LIFETIME]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_BOX]]
// CHECK: [[BORROWED_ARRAY_STACK:%.*]] = alloc_stack $Array<Int>
// CHECK: store [[ARRAY_COPY:%.*]] to [init] [[BORROWED_ARRAY_STACK]]
// CHECK: [[MAKE_ITERATOR_FUNC:%.*]] = function_ref @$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyF : $@convention(method) <τ_0_0 where τ_0_0 : Collection, τ_0_0.Iterator == IndexingIterator<τ_0_0>> (@in τ_0_0) -> @out IndexingIterator<τ_0_0>
Expand Down Expand Up @@ -148,7 +145,6 @@ func trivialStructBreak(_ xx: [Int]) {
// CHECK: br [[CONT_BLOCK]]
//
// CHECK: [[CONT_BLOCK]]
// CHECK: end_borrow [[ITERATOR_LIFETIME]]
// CHECK: destroy_value [[ITERATOR_BOX]] : ${ var IndexingIterator<Array<Int>> }
// CHECK: [[FUNC_END_FUNC:%.*]] = function_ref @funcEnd : $@convention(thin) () -> ()
// CHECK: apply [[FUNC_END_FUNC]]()
Expand Down Expand Up @@ -209,8 +205,7 @@ func existentialBreak(_ xx: [P]) {
// CHECK-LABEL: sil hidden [ossa] @$s7foreach24existentialContinueBreakyySayAA1P_pGF : $@convention(thin) (@guaranteed Array<any P>) -> () {
// CHECK: bb0([[ARRAY:%.*]] : @guaranteed $Array<any P>):
// CHECK: [[ITERATOR_BOX:%.*]] = alloc_box ${ var IndexingIterator<Array<any P>> }, var, name "$x$generator"
// CHECK: [[ITERATOR_LIFETIME:%[^,]+]] = begin_borrow [lexical] [[ITERATOR_BOX]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_LIFETIME]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_BOX]]
// CHECK: [[BORROWED_ARRAY_STACK:%.*]] = alloc_stack $Array<any P>
// CHECK: store [[ARRAY_COPY:%.*]] to [init] [[BORROWED_ARRAY_STACK]]
// CHECK: [[MAKE_ITERATOR_FUNC:%.*]] = function_ref @$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyF : $@convention(method) <τ_0_0 where τ_0_0 : Collection, τ_0_0.Iterator == IndexingIterator<τ_0_0>> (@in τ_0_0) -> @out IndexingIterator<τ_0_0>
Expand Down Expand Up @@ -259,7 +254,6 @@ func existentialBreak(_ xx: [P]) {
//
// CHECK: [[CONT_BLOCK]]
// CHECK: dealloc_stack [[ELT_STACK]]
// CHECK: end_borrow [[ITERATOR_LIFETIME]]
// CHECK: destroy_value [[ITERATOR_BOX]] : ${ var IndexingIterator<Array<any P>> }
// CHECK: [[FUNC_END_FUNC:%.*]] = function_ref @funcEnd : $@convention(thin) () -> ()
// CHECK: apply [[FUNC_END_FUNC]]()
Expand Down Expand Up @@ -371,8 +365,7 @@ func genericStructBreak<T>(_ xx: [GenericStruct<T>]) {
// CHECK-LABEL: sil hidden [ossa] @$s7foreach26genericStructContinueBreakyySayAA07GenericC0VyxGGlF : $@convention(thin) <T> (@guaranteed Array<GenericStruct<T>>) -> () {
// CHECK: bb0([[ARRAY:%.*]] : @guaranteed $Array<GenericStruct<T>>):
// CHECK: [[ITERATOR_BOX:%.*]] = alloc_box $<τ_0_0> { var IndexingIterator<Array<GenericStruct<τ_0_0>>> } <T>, var, name "$x$generator"
// CHECK: [[ITERATOR_LIFETIME:%[^,]+]] = begin_borrow [lexical] [[ITERATOR_BOX]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_LIFETIME]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_BOX]]
// CHECK: [[BORROWED_ARRAY_STACK:%.*]] = alloc_stack $Array<GenericStruct<T>>
// CHECK: store [[ARRAY_COPY:%.*]] to [init] [[BORROWED_ARRAY_STACK]]
// CHECK: [[MAKE_ITERATOR_FUNC:%.*]] = function_ref @$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyF : $@convention(method) <τ_0_0 where τ_0_0 : Collection, τ_0_0.Iterator == IndexingIterator<τ_0_0>> (@in τ_0_0) -> @out IndexingIterator<τ_0_0>
Expand Down Expand Up @@ -421,7 +414,6 @@ func genericStructBreak<T>(_ xx: [GenericStruct<T>]) {
//
// CHECK: [[CONT_BLOCK]]
// CHECK: dealloc_stack [[ELT_STACK]]
// CHECK: end_borrow [[ITERATOR_LIFETIME]]
// CHECK: destroy_value [[ITERATOR_BOX]]
// CHECK: [[FUNC_END_FUNC:%.*]] = function_ref @funcEnd : $@convention(thin) () -> ()
// CHECK: apply [[FUNC_END_FUNC]]()
Expand Down
9 changes: 3 additions & 6 deletions test/SILGen/foreach_async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ struct AsyncLazySequence<S: Sequence>: AsyncSequence {
// CHECK-LABEL: sil hidden [ossa] @$s13foreach_async13trivialStructyyAA17AsyncLazySequenceVySaySiGGYaF : $@convention(thin) @async (@guaranteed AsyncLazySequence<Array<Int>>) -> () {
// CHECK: bb0([[SOURCE:%.*]] : @guaranteed $AsyncLazySequence<Array<Int>>):
// CHECK: [[ITERATOR_BOX:%.*]] = alloc_box ${ var AsyncLazySequence<Array<Int>>.Iterator }, var, name "$x$generator"
// CHECK: [[ITERATOR_LIFETIME:%[^,]+]] = begin_borrow [lexical] [[ITERATOR_BOX]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_LIFETIME]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_BOX]]
// CHECK: br [[LOOP_DEST:bb[0-9]+]]

// CHECK: [[LOOP_DEST]]:
Expand Down Expand Up @@ -104,8 +103,7 @@ func trivialStruct(_ xx: AsyncLazySequence<[Int]>) async {
// CHECK-LABEL: sil hidden [ossa] @$s13foreach_async21trivialStructContinueyyAA17AsyncLazySequenceVySaySiGGYaF : $@convention(thin) @async (@guaranteed AsyncLazySequence<Array<Int>>) -> () {
// CHECK: bb0([[SOURCE:%.*]] : @guaranteed $AsyncLazySequence<Array<Int>>):
// CHECK: [[ITERATOR_BOX:%.*]] = alloc_box ${ var AsyncLazySequence<Array<Int>>.Iterator }, var, name "$x$generator"
// CHECK: [[ITERATOR_LIFETIME:%[^,]+]] = begin_borrow [lexical] [[ITERATOR_BOX]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_LIFETIME]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_BOX]]
// CHECK: br [[LOOP_DEST:bb[0-9]+]]

// CHECK: [[LOOP_DEST]]:
Expand Down Expand Up @@ -161,8 +159,7 @@ func trivialStructBreak(_ xx: AsyncLazySequence<[Int]>) async {
// CHECK-LABEL: sil hidden [ossa] @$s13foreach_async26trivialStructContinueBreakyyAA17AsyncLazySequenceVySaySiGGYaF : $@convention(thin) @async (@guaranteed AsyncLazySequence<Array<Int>>) -> ()
// CHECK: bb0([[SOURCE:%.*]] : @guaranteed $AsyncLazySequence<Array<Int>>):
// CHECK: [[ITERATOR_BOX:%.*]] = alloc_box ${ var AsyncLazySequence<Array<Int>>.Iterator }, var, name "$x$generator"
// CHECK: [[ITERATOR_LIFETIME:%[^,]+]] = begin_borrow [lexical] [[ITERATOR_BOX]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_LIFETIME]]
// CHECK: [[PROJECT_ITERATOR_BOX:%.*]] = project_box [[ITERATOR_BOX]]
// CHECK: br [[LOOP_DEST:bb[0-9]+]]

// CHECK: [[LOOP_DEST]]:
Expand Down
Loading