File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ bool swift::hasPointerEscape(SILValue original) {
82
82
return true ;
83
83
});
84
84
}
85
- while (auto value = worklist.popAndForget ()) {
85
+ while (auto value = worklist.pop ()) {
86
86
for (auto use : value->getUses ()) {
87
87
switch (use->getOperandOwnership ()) {
88
88
case OperandOwnership::PointerEscape:
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ import Builtin
6
6
7
7
class C {}
8
8
9
+ enum FakeOptional<T> {
10
+ case none
11
+ case some(T)
12
+ }
13
+
9
14
sil @getOwned : $@convention(thin) () -> (@owned C)
10
15
11
16
sil @borrow : $@convention(thin) (@guaranteed C) -> ()
@@ -42,3 +47,27 @@ exit(%instance : @owned $C):
42
47
%retval = tuple ()
43
48
return %retval : $()
44
49
}
50
+
51
+ sil [ossa] @test_loop_phi : $@convention(thin) () -> () {
52
+ entry:
53
+ %instance_1 = enum $FakeOptional<C>, #FakeOptional.none!enumelt
54
+ br loop_entry(%instance_1 : $FakeOptional<C>)
55
+
56
+ loop_entry(%18 : @owned $FakeOptional<C>):
57
+ test_specification "has-pointer-escape @block.argument"
58
+ br loop_body
59
+
60
+ loop_body:
61
+ cond_br undef, loop_back, loop_exit
62
+
63
+ loop_back:
64
+ br loop_entry(%18 : $FakeOptional<C>)
65
+
66
+ loop_exit:
67
+ destroy_value %18 : $FakeOptional<C>
68
+ br exit
69
+
70
+ exit:
71
+ %retval = tuple ()
72
+ return %retval : $()
73
+ }
You can’t perform that action at this time.
0 commit comments