File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
lib/SILOptimizer/Analysis Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ SILValue EscapeAnalysis::getPointerBase(SILValue value) {
122
122
case ValueKind::StructElementAddrInst:
123
123
case ValueKind::StructExtractInst:
124
124
case ValueKind::TupleElementAddrInst:
125
+ case ValueKind::BeginAccessInst:
125
126
case ValueKind::UncheckedTakeEnumDataAddrInst:
126
127
case ValueKind::UncheckedEnumDataInst:
127
128
case ValueKind::MarkDependenceInst:
Original file line number Diff line number Diff line change @@ -1888,3 +1888,25 @@ bb0(%0 : @guaranteed $@sil_unowned Builtin.NativeObject):
1888
1888
%1 = strong_copy_unowned_value %0 : $@sil_unowned Builtin.NativeObject
1889
1889
return %1 : $Builtin.NativeObject
1890
1890
}
1891
+
1892
+ // Test begin_access. It should look like a derived pointer.
1893
+ // CHECK-LABEL: CG of testAccessMarkerHelper
1894
+ sil hidden @testAccessMarkerHelper : $@convention(thin) (@inout SomeData) -> () {
1895
+ bb0(%0 : $*SomeData):
1896
+ %1 = tuple ()
1897
+ return %1 : $()
1898
+ }
1899
+
1900
+ // CHECK-LABEL: CG of testAccessMarker
1901
+ // CHECK-NEXT: Arg %0 Esc: A, Succ: (%0.1)
1902
+ // CHECK-NEXT: Con [ref] %0.1 Esc: G, Succ:
1903
+ // CHECK-LABEL: End
1904
+ sil hidden @testAccessMarker : $@convention(thin) (@inout SomeData) -> () {
1905
+ bb0(%0 : $*SomeData):
1906
+ %1 = begin_access [modify] [static] %0 : $*SomeData
1907
+ %2 = function_ref @testAccessMarkerHelper : $@convention(thin) (@inout SomeData) -> ()
1908
+ %3 = apply %2(%1) : $@convention(thin) (@inout SomeData) -> ()
1909
+ end_access %1 : $*SomeData
1910
+ %5 = tuple ()
1911
+ return %5 : $()
1912
+ }
You can’t perform that action at this time.
0 commit comments