Skip to content

Commit 6865c42

Browse files
committed
Remove address phis from SIL tests
1 parent 923c62c commit 6865c42

14 files changed

+58
-292
lines changed

test/SILOptimizer/access_enforcement_opts.sil

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,46 +1550,6 @@ bb0:
15501550
return %10 : $()
15511551
}
15521552

1553-
// public func testPhiArgs() {
1554-
// Check that we can merge scopes with Phi args - avoiding a crash we've seen in the past
1555-
//
1556-
// CHECK-LABEL: sil @testPhiArgs : $@convention(thin) () -> () {
1557-
// CHECK: [[GLOBAL:%.*]] = global_addr @globalX : $*X
1558-
// CHECK: cond_br {{.*}}, bb1, bb2
1559-
// CHECK: bb1
1560-
// CHECK: br bb3([[GLOBAL]] : $*X)
1561-
// CHECK: bb2
1562-
// CHECK: br bb3([[GLOBAL]] : $*X)
1563-
// CHECK: bb3([[GLOBALPHI:%.*]] : $*X):
1564-
// CHECK: [[BEGIN:%.*]] = begin_access [read] [dynamic] [no_nested_conflict] [[GLOBALPHI]] : $*X
1565-
// CHECK-NEXT: load
1566-
// CHECK-NEXT: load
1567-
// CHECK-NEXT: end_access [[BEGIN]] : $*X
1568-
// CHECK-NOT: begin_access
1569-
// CHECK-LABEL: } // end sil function 'testPhiArgs'
1570-
sil @testPhiArgs : $@convention(thin) () -> () {
1571-
bb0:
1572-
%0 = global_addr @globalX: $*X
1573-
%cond = integer_literal $Builtin.Int1, 1
1574-
cond_br %cond, bb1, bb2
1575-
1576-
bb1:
1577-
br bb3(%0 : $*X)
1578-
1579-
bb2:
1580-
br bb3(%0 : $*X)
1581-
1582-
bb3(%1 : $*X):
1583-
%2 = begin_access [read] [dynamic] %1 : $*X
1584-
%3 = load %2 : $*X
1585-
end_access %2 : $*X
1586-
%4 = begin_access [read] [dynamic] %0 : $*X
1587-
%5 = load %4 : $*X
1588-
end_access %4 : $*X
1589-
%10 = tuple ()
1590-
return %10 : $()
1591-
}
1592-
15931553
// --- rdar://48239213: Fatal access conflict detected.
15941554
//
15951555
// The read/modify pair of accesses in testReadModifyConflictPair

test/SILOptimizer/access_storage_analysis.sil

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -651,41 +651,6 @@ bb3(%result : $Int):
651651
return %result : $Int
652652
}
653653

654-
// Make sure identifyFormalAccess returns a valid storage object for an address-phi
655-
// that feeds ref_element_addr instructions. The ref_element_addr's need to have the
656-
// same base object and same field id.
657-
// <rdar://problem/46114512> SIL verification failed: Unknown formal access pattern: storage
658-
class BaseClass {
659-
var f: Float = 0.0
660-
}
661-
662-
class SubClass : BaseClass {}
663-
664-
// CHECK-LABEL: @testElementAddressPhiAccess
665-
// CHECK: [read] [no_nested_conflict] Class %{{.*}} = argument of bb0 : $SubClass
666-
// CHECK: Field: @_hasInitialValue var f: Float
667-
sil @testElementAddressPhiAccess : $@convention(thin) (@guaranteed SubClass) -> () {
668-
bb0(%0 : $SubClass):
669-
%base = upcast %0 : $SubClass to $BaseClass
670-
cond_br undef, bb1, bb2
671-
672-
bb1:
673-
%ref1 = ref_element_addr %base : $BaseClass, #BaseClass.f
674-
br bb3(%ref1 : $*Float)
675-
676-
bb2:
677-
%ref2 = ref_element_addr %base : $BaseClass, #BaseClass.f
678-
br bb3(%ref2 : $*Float)
679-
680-
bb3(%phi : $*Float):
681-
%access = begin_access [read] [dynamic] [no_nested_conflict] %phi : $*Float
682-
%addr = struct_element_addr %access : $*Float, #Float._value
683-
%val = load %addr : $*Builtin.FPIEEE32
684-
end_access %access : $*Float
685-
%v = tuple ()
686-
return %v : $()
687-
}
688-
689654
// Test an inlined global variable addressor after simplify-cfg has
690655
// cloned the call to the addressor.
691656
// <rdar://problem/47555992> SIL verification failed: Unknown formal access pattern

test/SILOptimizer/basic-aa.sil

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,6 @@ bb0(%0 : $*Builtin.NativeObject, %1 : $*Builtin.NativeObject):
9393
return %2 : $()
9494
}
9595

96-
// Address Arguments may alias if they are arguments to a BB besides the first.
97-
//
98-
// FIXME: Once we support looking through PHIs, we will allow for must alias here.
99-
//
100-
// CHECK-LABEL: @address_args_may_alias_in_non_first_bb
101-
// CHECK-NOT: NoAlias
102-
sil @address_args_may_alias_in_non_first_bb : $@convention(thin) (@inout Builtin.NativeObject) -> () {
103-
bb0(%0 : $*Builtin.NativeObject):
104-
br bb1(%0 : $*Builtin.NativeObject, %0 : $*Builtin.NativeObject)
105-
106-
bb1(%1 : $*Builtin.NativeObject, %2 : $*Builtin.NativeObject):
107-
%3 = tuple()
108-
return %3 : $()
109-
}
110-
11196
// Assume that inout arguments alias to preserve memory safety.
11297
//
11398
// CHECK-LABEL: @inout_args_may_not_alias

test/SILOptimizer/cowarray_opt.sil

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ struct MyInt {
578578
// CHECK: [[EM:%[0-9]+]] = function_ref @array_end_mutation
579579
// CHECK: apply [[EM]]([[ARRAY]]
580580
// CHECK: bb1:
581-
// CHECK: bb2({{.*}}):
581+
// CHECK: bb2:
582582
// CHECK: apply [[MM]]([[ARRAY]]
583583
// CHECK: apply [[EM]]([[ARRAY]]
584584
// CHECK: } // end sil function 'hoist_projections'
@@ -587,10 +587,10 @@ bb0(%0 : $*ContainerContainer, %1 : $*Builtin.Int1):
587587
br bb1
588588

589589
bb1:
590-
%2 = struct_element_addr %0 : $*ContainerContainer, #ContainerContainer.container
591-
br bb3(%2 : $*Container)
590+
br bb3
592591

593-
bb3(%3: $*Container):
592+
bb3:
593+
%3 = struct_element_addr %0 : $*ContainerContainer, #ContainerContainer.container
594594
%4 = struct_element_addr %3 : $*Container, #Container.array
595595
%5 = function_ref @array_make_mutable : $@convention(method) (@inout MyArray<MyStruct>) -> ()
596596
%6 = apply %5(%4) : $@convention(method) (@inout MyArray<MyStruct>) -> ()
@@ -613,7 +613,7 @@ bb2:
613613
// CHECK: [[EM:%[0-9]+]] = function_ref @array_end_mutation
614614
// CHECK: apply [[EM]]([[ARRAY]]
615615
// CHECK: bb1:
616-
// CHECK: bb2({{.*}}):
616+
// CHECK: bb2:
617617
// CHECK: apply [[MM]]([[ARRAY]]
618618
// CHECK: apply [[EM]]([[ARRAY]]
619619
// CHECK: } // end sil function 'hoist_non_unary_projections'
@@ -623,10 +623,10 @@ bb0(%0 : $*ContainerContainer, %1 : $*Builtin.Int1):
623623
br bb1
624624

625625
bb1:
626-
%2 = struct_element_addr %0 : $*ContainerContainer, #ContainerContainer.container
627-
br bb2(%2 : $*Container)
626+
br bb2
628627

629-
bb2(%3: $*Container):
628+
bb2:
629+
%3 = struct_element_addr %0 : $*ContainerContainer, #ContainerContainer.container
630630
%3i = index_addr %3 : $*Container, %i : $Builtin.Int32
631631
%4 = struct_element_addr %3i : $*Container, #Container.array
632632
%5 = function_ref @array_make_mutable : $@convention(method) (@inout MyArray<MyStruct>) -> ()
@@ -649,7 +649,7 @@ bb3:
649649
// CHECK: [[EM:%[0-9]+]] = function_ref @array_end_mutation
650650
// CHECK: apply [[EM]]([[ARRAY]]
651651
// CHECK: bb1:
652-
// CHECK: bb2({{.*}}):
652+
// CHECK: bb2:
653653
// CHECK: apply [[MM]]([[ARRAY]]
654654
// CHECK: apply [[EM]]
655655
// CHECK: } // end sil function 'hoist_projections2'
@@ -658,11 +658,11 @@ bb0(%0 : $*ContainerContainer, %1 : $*Builtin.Int1):
658658
br bb1
659659

660660
bb1:
661-
%2 = struct_element_addr %0 : $*ContainerContainer, #ContainerContainer.container
662-
%3 = struct_element_addr %2 : $*Container, #Container.array
663-
br bb3(%3 : $*MyArray<MyStruct>)
661+
br bb3
664662

665-
bb3(%4 : $*MyArray<MyStruct>):
663+
bb3:
664+
%2 = struct_element_addr %0 : $*ContainerContainer, #ContainerContainer.container
665+
%4 = struct_element_addr %2 : $*Container, #Container.array
666666
%5 = function_ref @array_make_mutable : $@convention(method) (@inout MyArray<MyStruct>) -> ()
667667
%6 = apply %5(%4) : $@convention(method) (@inout MyArray<MyStruct>) -> ()
668668
%7 = function_ref @array_end_mutation : $@convention(method) (@inout MyArray<MyStruct>) -> ()

test/SILOptimizer/escape_analysis.sil

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,53 +1740,6 @@ bb10(%arg3 : $C):
17401740
return %66 : $()
17411741
}
17421742

1743-
// Test canEscapeToUsePoint with defer edges between non-reference-type nodes.
1744-
//
1745-
// Unfortunately, the only way I can think of to create defer edges
1746-
// between non-reference nodes is with address-type block arguments.
1747-
// This will be banned soon, so the test will need to be disabled, but
1748-
// this is still an important corner case in the EscapeAnalysis
1749-
// logic. To keep the test working, and be able to test many more
1750-
// important corner cases, we should introduce testing modes that
1751-
// introduce spurious but predictable defer edges and node merges.
1752-
//
1753-
// Here, canEscapeTo is called on %bbarg (%5) whose node is not
1754-
// marked escaping. But it does have a defer edge to the local address
1755-
// (%0) which does cause the address to escape via the call site.
1756-
//
1757-
// CHECK-LABEL: CG of testDeferPointer
1758-
// CHECK-NEXT: Val %0 Esc: , Succ: (%0.1)
1759-
// CHECK-NEXT: Con [ref] %0.1 Esc: G, Succ:
1760-
// CHECK-NEXT: Val %1 Esc: , Succ: (%0.1)
1761-
// CHECK-NEXT: Val %5 Esc: , Succ: %0, %1
1762-
// CHECK-LABEL: End
1763-
// CHECK: MayEscape: %5 = argument of bb3 : $*Builtin.Int32
1764-
// CHECK-NEXT: to %{{.*}} = apply %{{.*}}(%0) : $@convention(thin) (@inout Builtin.Int32) -> ()
1765-
sil @takeAdr : $@convention(thin) (@inout Builtin.Int32) -> ()
1766-
1767-
sil hidden @testDeferPointer : $@convention(thin) () -> () {
1768-
bb0:
1769-
%iadr1 = alloc_stack $Builtin.Int32
1770-
%iadr2 = alloc_stack $Builtin.Int32
1771-
cond_br undef, bb1, bb2
1772-
1773-
bb1:
1774-
br bb3(%iadr1: $*Builtin.Int32)
1775-
1776-
bb2:
1777-
br bb3(%iadr2: $*Builtin.Int32)
1778-
1779-
bb3(%bbarg: $*Builtin.Int32):
1780-
%val = integer_literal $Builtin.Int32, 1
1781-
store %val to %bbarg : $*Builtin.Int32
1782-
%ftake = function_ref @takeAdr : $@convention(thin) (@inout Builtin.Int32) -> ()
1783-
%call = apply %ftake(%iadr1) : $@convention(thin) (@inout Builtin.Int32) -> ()
1784-
dealloc_stack %iadr2 : $*Builtin.Int32
1785-
dealloc_stack %iadr1 : $*Builtin.Int32
1786-
%z = tuple ()
1787-
return %z : $()
1788-
}
1789-
17901743
// Test interior node (self) cycles.
17911744

17921745
class IntWrapper {

test/SILOptimizer/licm.sil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,14 @@ bb0:
312312
%5 = function_ref @use_value : $@convention(thin) (Builtin.Int32) -> ()
313313
%unknown_value_fn = function_ref @get_unknown_value2 : $@convention(thin) () -> Builtin.Int32
314314
store %1 to %0 : $*Builtin.Int32
315-
br bb1(%0 : $*Builtin.Int32)
315+
br bb1
316316

317-
bb1(%phi1 : $*Builtin.Int32):
317+
bb1:
318318
br bb2
319319

320320
bb2:
321321
apply %3(%0) : $@convention(thin) (@inout Builtin.Int32) -> ()
322-
%4 = load %phi1 : $*Builtin.Int32
322+
%4 = load %0 : $*Builtin.Int32
323323
%6 = apply %unknown_value_fn() : $@convention(thin) () -> Builtin.Int32
324324
%33 = builtin "cmp_eq_Int32"(%4 : $Builtin.Int32, %6 : $Builtin.Int32) : $Builtin.Int1
325325
cond_br %33, bb2, bb3

test/SILOptimizer/looprotate.sil

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ bb0(%0 : $Int32, %25: $Bar):
5555
%2 = integer_literal $Builtin.Int32, 0
5656
%30 = alloc_box $<τ_0_0> { var τ_0_0 } <Bool>
5757
%30a = project_box %30 : $<τ_0_0> { var τ_0_0 } <Bool>, 0
58-
br bb1(%1 : $Builtin.Int32, %2 : $Builtin.Int32, %25: $Bar, %30 : $<τ_0_0> { var τ_0_0 } <Bool>, %30a : $*Bool)
58+
br bb1(%1 : $Builtin.Int32, %2 : $Builtin.Int32, %25: $Bar, %30 : $<τ_0_0> { var τ_0_0 } <Bool>)
5959

60-
bb1(%4 : $Builtin.Int32, %5 : $Builtin.Int32, %26: $Bar, %31 : $<τ_0_0> { var τ_0_0 } <Bool>, %32 : $*Bool):
60+
bb1(%4 : $Builtin.Int32, %5 : $Builtin.Int32, %26: $Bar, %31 : $<τ_0_0> { var τ_0_0 } <Bool>):
6161
%24 = class_method %26 : $Bar, #Bar.foo : (Bar) -> () -> (), $@convention(method) (@guaranteed Bar) -> () // user: %6
6262
%27 = apply %24(%25) : $@convention(method) (@guaranteed Bar) -> ()
6363
%6 = struct $Int32 (%5 : $Builtin.Int32)
@@ -75,7 +75,7 @@ bb2:
7575
%19 = integer_literal $Builtin.Int1, -1
7676
%20 = builtin "sadd_with_overflow_Word"(%4 : $Builtin.Int32, %17 : $Builtin.Int32, %19 : $Builtin.Int1) : $(Builtin.Int32, Builtin.Int1)
7777
%21 = tuple_extract %20 : $(Builtin.Int32, Builtin.Int1), 0
78-
br bb1(%21 : $Builtin.Int32, %14 : $Builtin.Int32, %26: $Bar, %31 : $<τ_0_0> { var τ_0_0 } <Bool>, %32 : $*Bool)
78+
br bb1(%21 : $Builtin.Int32, %14 : $Builtin.Int32, %26: $Bar, %31 : $<τ_0_0> { var τ_0_0 } <Bool>)
7979

8080
bb3:
8181
%23 = struct $Int32 (%4 : $Builtin.Int32)
@@ -105,9 +105,9 @@ bb0(%0 : $Int32, %25: $Bar):
105105
%2 = integer_literal $Builtin.Int32, 0
106106
%30 = alloc_box $<τ_0_0> { var τ_0_0 } <Bool>
107107
%30a = project_box %30 : $<τ_0_0> { var τ_0_0 } <Bool>, 0
108-
br bb1(%1 : $Builtin.Int32, %2 : $Builtin.Int32, %25: $Bar, %30 : $<τ_0_0> { var τ_0_0 } <Bool>, %30a : $*Bool)
108+
br bb1(%1 : $Builtin.Int32, %2 : $Builtin.Int32, %25: $Bar, %30 : $<τ_0_0> { var τ_0_0 } <Bool>)
109109

110-
bb1(%4 : $Builtin.Int32, %5 : $Builtin.Int32, %26: $Bar, %31 : $<τ_0_0> { var τ_0_0 } <Bool>, %32 : $*Bool):
110+
bb1(%4 : $Builtin.Int32, %5 : $Builtin.Int32, %26: $Bar, %31 : $<τ_0_0> { var τ_0_0 } <Bool>):
111111
%24 = class_method %26 : $Bar, #Bar.foo : (Bar) -> () -> (), $@convention(method) (@guaranteed Bar) -> () // user: %6
112112
%27 = apply %24(%25) : $@convention(method) (@guaranteed Bar) -> ()
113113
%28 = apply %24(%25) : $@convention(method) (@guaranteed Bar) -> ()
@@ -149,7 +149,7 @@ bb2:
149149
%19 = integer_literal $Builtin.Int1, -1
150150
%20 = builtin "sadd_with_overflow_Word"(%4 : $Builtin.Int32, %17 : $Builtin.Int32, %19 : $Builtin.Int1) : $(Builtin.Int32, Builtin.Int1)
151151
%21 = tuple_extract %20 : $(Builtin.Int32, Builtin.Int1), 0
152-
br bb1(%21 : $Builtin.Int32, %14 : $Builtin.Int32, %26: $Bar, %31 : $<τ_0_0> { var τ_0_0 } <Bool>, %32 : $*Bool)
152+
br bb1(%21 : $Builtin.Int32, %14 : $Builtin.Int32, %26: $Bar, %31 : $<τ_0_0> { var τ_0_0 } <Bool>)
153153

154154
bb3:
155155
%23 = struct $Int32 (%4 : $Builtin.Int32)
@@ -205,9 +205,9 @@ bb0(%0 : $Int32, %25: $*P):
205205
%30 = alloc_box $<τ_0_0> { var τ_0_0 } <Bool>
206206
%30a = project_box %30 : $<τ_0_0> { var τ_0_0 } <Bool>, 0
207207
%40 = open_existential_addr immutable_access %25 : $*P to $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83", P) Self
208-
br bb1(%1 : $Builtin.Int32, %2 : $Builtin.Int32, %25: $*P, %30 : $<τ_0_0> { var τ_0_0 } <Bool>, %30a : $*Bool)
208+
br bb1(%1 : $Builtin.Int32, %2 : $Builtin.Int32, %30 : $<τ_0_0> { var τ_0_0 } <Bool>)
209209

210-
bb1(%4 : $Builtin.Int32, %5 : $Builtin.Int32, %26: $*P, %31 : $<τ_0_0> { var τ_0_0 } <Bool>, %32 : $*Bool):
210+
bb1(%4 : $Builtin.Int32, %5 : $Builtin.Int32, %31 : $<τ_0_0> { var τ_0_0 } <Bool>):
211211
%111 = witness_method $@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83", P) Self, #P.boo, %40 : $*@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83", P) Self : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int64
212212
%122 = apply %111<@opened("C22498FA-CABF-11E5-B9A9-685B35C48C83", P) Self>(%40) : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> Int64
213213
%6 = struct $Int32 (%5 : $Builtin.Int32)
@@ -225,7 +225,7 @@ bb2:
225225
%19 = integer_literal $Builtin.Int1, -1
226226
%20 = builtin "sadd_with_overflow_Word"(%4 : $Builtin.Int32, %17 : $Builtin.Int32, %19 : $Builtin.Int1) : $(Builtin.Int32, Builtin.Int1)
227227
%21 = tuple_extract %20 : $(Builtin.Int32, Builtin.Int1), 0
228-
br bb1(%21 : $Builtin.Int32, %14 : $Builtin.Int32, %26: $*P, %31 : $<τ_0_0> { var τ_0_0 } <Bool>, %32 : $*Bool)
228+
br bb1(%21 : $Builtin.Int32, %14 : $Builtin.Int32, %31 : $<τ_0_0> { var τ_0_0 } <Bool>)
229229

230230
bb3:
231231
%23 = struct $Int32 (%4 : $Builtin.Int32)

test/SILOptimizer/looprotate_ossa.sil

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -476,28 +476,24 @@ bb2:
476476
//
477477
// CHECK-LABEL: sil [ossa] @addressPhiFixUp : $@convention(thin) (Builtin.RawPointer) -> Builtin.RawPointer {
478478
// CHECK: bb1:
479-
// CHECK: [[NEXT:%.*]] = address_to_pointer {{%.*}} : $*UInt8 to $Builtin.RawPointer
480479
// CHECK: cond_br {{%.*}}, bb3, bb2
481480
//
482481
// CHECK: bb2:
483-
// CHECK-NEXT: br bb7(%0 : $Builtin.RawPointer)
482+
// CHECK-NEXT: br bb7
484483
//
485484
// CHECK: bb3:
486-
// CHECK-NEXT: br bb4([[NEXT]] : $Builtin.RawPointer)
485+
// CHECK-NEXT: br bb4
487486
//
488487
// CHECK: bb4([[ARG:%.*]] :
489488
// CHECK: [[CAST_BACK:%.*]] = pointer_to_address [[ARG]] : $Builtin.RawPointer to [strict] $*UInt8
490489
// CHECK: [[GEP:%.*]] = index_addr [[CAST_BACK]] :
491-
// CHECK: [[CAST_ROUND_TRIP_START:%.*]] = address_to_pointer [[GEP]]
492-
// CHECK: [[CAST_ROUND_TRIP_END:%.*]] = pointer_to_address [[CAST_ROUND_TRIP_START]] : $Builtin.RawPointer to [strict] $*UInt8
493-
// CHECK: [[BACK_TO_RAWPOINTER:%.*]] = address_to_pointer [[CAST_ROUND_TRIP_END]]
494490
// CHECK: cond_br {{%.*}}, bb6, bb5
495491
//
496492
// CHECK: bb5:
497-
// CHECK-NEXT: br bb7([[CAST_ROUND_TRIP_START]] :
493+
// CHECK-NEXT: br bb7
498494
//
499495
// CHECK: bb6:
500-
// CHECK-NEXT: br bb4([[BACK_TO_RAWPOINTER]] :
496+
// CHECK-NEXT: br bb4
501497
//
502498
// CHECK: bb7([[RESULT:%.*]] :
503499
// CHECK-NEXT: return [[RESULT]]

test/SILOptimizer/redundant_load_elim.sil

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,29 +1201,6 @@ bb0(%0 : $Builtin.RawPointer):
12011201

12021202
sil @overwrite_int : $@convention(thin) (@inout Int, Int) -> ()
12031203

1204-
// CHECK-LABEL: sil @test_address_block_args
1205-
// CHECK: bb2({{.*}}):
1206-
// CHECK: apply
1207-
// CHECK: [[L:%.*]] = load
1208-
// CHECK: return [[L]]
1209-
sil @test_address_block_args : $@convention(thin) (Int) -> Int {
1210-
bb0(%0 : $Int):
1211-
%4 = alloc_stack $Int
1212-
store %0 to %4 : $*Int
1213-
cond_br undef, bb1(%4 : $*Int), bb2(%4 : $*Int)
1214-
1215-
bb1(%a1 : $*Int):
1216-
br bb2(%a1 : $*Int)
1217-
1218-
bb2(%a : $*Int):
1219-
%l1 = load %a : $*Int
1220-
%60 = function_ref @overwrite_int : $@convention(thin) (@inout Int, Int) -> ()
1221-
%61 = apply %60(%4, %l1) : $@convention(thin) (@inout Int, Int) -> ()
1222-
%r = load %a : $*Int
1223-
dealloc_stack %4 : $*Int
1224-
return %r : $Int
1225-
}
1226-
12271204
// Make sure that the store is forwarded to the load, ie. the load is
12281205
// eliminated. That's correct as the stored value can't be changed by the
12291206
// callee as it's passed with @in_guaranteed.

0 commit comments

Comments
 (0)