@@ -1332,7 +1332,7 @@ class RefElemClass {
1332
1332
// CHECK-NEXT: [[REFY:%.*]] = ref_element_addr %0 : $RefElemClass, #RefElemClass.y
1333
1333
// CHECK-NEXT: [[BEGINX:%.*]] = begin_access [modify] [dynamic] [[REFX]] : $*BitfieldOne
1334
1334
// CHECK: end_access [[BEGINX]] : $*BitfieldOne
1335
- // CHECK: [[BEGINY:%.*]] = begin_access [modify] [dynamic] [no_nested_conflict] [ [REFY]] : $*Int32
1335
+ // CHECK: [[BEGINY:%.*]] = begin_access [modify] [dynamic] [[REFY]] : $*Int32
1336
1336
// CHECK: [[BEGINX2:%.*]] = begin_access [modify] [dynamic] [no_nested_conflict] [[REFX]] : $*BitfieldOne
1337
1337
// CHECK-NEXT: end_access [[BEGINX2]] : $*BitfieldOne
1338
1338
// CHECK-NEXT: end_access [[BEGINY]] : $*Int32
@@ -1358,6 +1358,34 @@ bb0(%0 : $RefElemClass):
1358
1358
return %10 : $()
1359
1359
}
1360
1360
1361
+ class RefElemNoConflictClass {
1362
+ var x : Int32
1363
+ var y : Int32
1364
+ init()
1365
+ }
1366
+
1367
+ // Checks that we can detect not having a nested conflict in class when we are accessing
1368
+ // fields that do no alias
1369
+ // CHECK-LABEL: sil @ref_elem_no_alias : $@convention(thin) (RefElemNoConflictClass) -> () {
1370
+ // CHECK: [[REFX:%.*]] = ref_element_addr %0 : $RefElemNoConflictClass, #RefElemNoConflictClass.x
1371
+ // CHECK-NEXT: [[REFY:%.*]] = ref_element_addr %0 : $RefElemNoConflictClass, #RefElemNoConflictClass.y
1372
+ // CHECK: [[BEGINY:%.*]] = begin_access [modify] [dynamic] [no_nested_conflict] [[REFY]] : $*Int32
1373
+ // CHECK: [[BEGINX:%.*]] = begin_access [modify] [dynamic] [no_nested_conflict] [[REFX]] : $*Int32
1374
+ // CHECK-NEXT: end_access [[BEGINX]] : $*Int32
1375
+ // CHECK-NEXT: end_access [[BEGINY]] : $*Int32
1376
+ // CHECK-LABEL: } // end sil function 'ref_elem_no_alias'
1377
+ sil @ref_elem_no_alias : $@convention(thin) (RefElemNoConflictClass) -> () {
1378
+ bb0(%0 : $RefElemNoConflictClass):
1379
+ %x = ref_element_addr %0 : $RefElemNoConflictClass, #RefElemNoConflictClass.x
1380
+ %y = ref_element_addr %0 : $RefElemNoConflictClass, #RefElemNoConflictClass.y
1381
+ %b2 = begin_access [modify] [dynamic] %y : $*Int32
1382
+ %b3 = begin_access [modify] [dynamic] %x : $*Int32
1383
+ end_access %b3 : $*Int32
1384
+ end_access %b2 : $*Int32
1385
+ %10 = tuple ()
1386
+ return %10 : $()
1387
+ }
1388
+
1361
1389
// public func testStronglyConnectedComponent() {
1362
1390
// During the merge optimization,
1363
1391
// Check that we don't merge cross strongly component boundaries for now
0 commit comments