Skip to content

Commit 785834c

Browse files
committed
[Test] Replaced argument with call result.
The test verifies the behavior of CanonicalizeOSSALifetime on adjacent phis. Previously, it was being run on a phi one of whose incoming values was lexical. Now that phis any of whose transitive incoming values are lexical are themselves recognized as lexical, the lifetime is not being canonicalized. When lexical lifetimes are canonicalized, this will not be necessary.
1 parent 7ea4523 commit 785834c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/SILOptimizer/copy_propagation_canonicalize_with_reborrows.sil

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,15 @@ bb1(%4 : @guaranteed $X, %5 : @owned $X):
297297
// Lifetime analysis is successful; the copy/destroy in bb1 are removed. The
298298
// end_borrow/destroy maintain their position.
299299
//
300-
// CHECK-LABEL: sil [ossa] @reborrow_adjacent_to_consume : $@convention(thin) (@owned X) -> () {
300+
// CHECK-LABEL: sil [ossa] @reborrow_adjacent_to_consume : $@convention(thin) () -> () {
301301
// CHECK: bb1(%{{.*}} : @guaranteed $X, %{{.*}} : @owned $X):
302302
// CHECK-NEXT: br bb2
303303
// CHECK: bb2(%{{.*}} : @guaranteed $X, %{{.*}} : @owned $X):
304304
// CHECK-NEXT: end_borrow
305305
// CHECK-NEXT: destroy_value
306-
sil [ossa] @reborrow_adjacent_to_consume : $@convention(thin) (@owned X) -> () {
307-
bb0(%0 : @owned $X):
306+
sil [ossa] @reborrow_adjacent_to_consume : $@convention(thin) () -> () {
307+
bb0:
308+
%0 = apply undef() : $@convention(thin) () -> (@owned X)
308309
%1 = begin_borrow %0 : $X
309310
br bb1(%1 : $X, %0 : $X)
310311

@@ -328,14 +329,15 @@ bb2(%6 : @guaranteed $X, %7 : @owned $X):
328329
//
329330
// Lifetime analysis is successful; the copy/destroy in bb2 are removed.
330331
//
331-
// CHECK-LABEL: sil [ossa] @reborrow_no_adjacent_consume : $@convention(thin) (@owned X) -> () {
332+
// CHECK-LABEL: sil [ossa] @reborrow_no_adjacent_consume : $@convention(thin) () -> () {
332333
// CHECK: bb1(%{{.*}} : @guaranteed $X, %{{.*}} : @owned $X):
333334
// CHECK-NEXT: br bb2
334335
// CHECK: bb2(%{{.*}} : @guaranteed $X):
335336
// CHECK-NEXT: end_borrow
336337
// CHECK-NEXT: destroy_value
337-
sil [ossa] @reborrow_no_adjacent_consume : $@convention(thin) (@owned X) -> () {
338-
bb0(%0 : @owned $X):
338+
sil [ossa] @reborrow_no_adjacent_consume : $@convention(thin) () -> () {
339+
bb0:
340+
%0 = apply undef() : $@convention(thin) () -> (@owned X)
339341
%1 = begin_borrow %0 : $X
340342
br bb1(%1 : $X, %0 : $X)
341343

0 commit comments

Comments
 (0)