Skip to content

Commit 2974031

Browse files
committed
Update ConditionForwarding tests
1 parent 022122c commit 2974031

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

test/SILOptimizer/conditionforwarding_nontrivial_ossa.sil

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,20 @@ bb6:
7171
return %r : $()
7272
}
7373

74-
// Currently, this is not optimized away because memory behavior of begin_borrow is conservative
7574
// CHECK-LABEL: sil [ossa] @simple_forwarding2 :
76-
// CHECK: switch_enum
75+
// CHECK-NOT: switch_enum
7776
// CHECK-LABEL: } // end sil function 'simple_forwarding2'
7877
sil [ossa] @simple_forwarding2 : $@convention(thin) (Builtin.Int1, @guaranteed Klass) -> () {
7978
bb0(%0 : $Builtin.Int1, %1 : @guaranteed $Klass):
8079
cond_br %0, bb1, bb2
8180

8281
bb1:
8382
%2 = enum $E, #E.A!enumelt, %1 : $Klass
84-
%borrow2 = begin_borrow %2 : $E
85-
br bb3(%borrow2 : $E)
83+
br bb3(%2 : $E)
8684

8785
bb2:
8886
%3 = enum $E, #E.B!enumelt, %1 : $Klass
89-
%borrow3 = begin_borrow %3 : $E
90-
br bb3(%borrow3 : $E)
87+
br bb3(%3 : $E)
9188

9289
bb3(%14 : @guaranteed $E):
9390
%15 = function_ref @callee : $@convention(thin) () -> ()
@@ -101,7 +98,6 @@ bb5(%18 : @guaranteed $Klass):
10198
br bb6
10299

103100
bb6:
104-
end_borrow %14 : $E
105101
%r = tuple ()
106102
return %r : $()
107103
}
@@ -187,22 +183,20 @@ bb6:
187183

188184
// CHECK-LABEL: sil [ossa] @simple_switch_enum_forwarding2 :
189185
// CHECK: switch_enum
190-
// CHECK: switch_enum
186+
// CHECK-NOT: switch_enum
191187
// CHECK-LABEL: } // end sil function 'simple_switch_enum_forwarding2'
192188
sil [ossa] @simple_switch_enum_forwarding2 : $@convention(thin) (@guaranteed E3) -> () {
193189
bb0(%0 : @guaranteed $E3):
194190
switch_enum %0 : $E3, case #E3.A!enumelt: bb1, default bb2
195191

196192
bb1(%1 : @guaranteed $Klass):
197193
%2 = enum $E, #E.A!enumelt, %1 : $Klass
198-
%borrow2 = begin_borrow %2 : $E
199-
br bb3(%borrow2 : $E)
194+
br bb3(%2 : $E)
200195

201196
bb2(%defaultenum : @guaranteed $E3):
202197
%defaultklass = unchecked_enum_data %defaultenum : $E3, #E3.B!enumelt
203198
%3 = enum $E, #E.B!enumelt, %defaultklass : $Klass
204-
%borrow3 = begin_borrow %3 : $E
205-
br bb3(%borrow3 : $E)
199+
br bb3(%3 : $E)
206200

207201
bb3(%14 : @guaranteed $E):
208202
%15 = function_ref @callee : $@convention(thin) () -> ()
@@ -216,7 +210,6 @@ bb5(%5 : @guaranteed $Klass):
216210
br bb6
217211

218212
bb6:
219-
end_borrow %14 : $E
220213
%r = tuple ()
221214
return %r : $()
222215
}

0 commit comments

Comments
 (0)