@@ -540,3 +540,47 @@ bb4:
540
540
%10 = tuple ()
541
541
return %10 : $()
542
542
}
543
+
544
+ // public func testBailOnNestedDomWrite() {
545
+ // Checks that we bail when the dominated begin comes before the dominating begin
546
+ //
547
+ // CHECK-LABEL: sil @testBailOnNestedDomWrite : $@convention(thin) () -> () {
548
+ // CHECK: bb0:
549
+ // CHECK: [[GLOBAL:%.*]] = global_addr @globalX : $*X
550
+ // CHECK: [[BEGIN:%.*]] = begin_access [modify] [dynamic] [[GLOBAL]] : $*X
551
+ // CHECK: [[BEGIN2:%.*]] = begin_access [modify] [dynamic] [no_nested_conflict] [[GLOBAL]] : $*X
552
+ // CHECK-LABEL: } // end sil function 'testBailOnNestedDomWrite'
553
+ sil @testBailOnNestedDomWrite : $@convention(thin) () -> () {
554
+ bb0:
555
+ %0 = global_addr @globalX: $*X
556
+ %4 = begin_access [modify] [dynamic] %0 : $*X
557
+ %5 = load %4 : $*X
558
+ %7 = begin_access [modify] [dynamic] [no_nested_conflict] %0 : $*X
559
+ %8 = load %7 : $*X
560
+ end_access %7 : $*X
561
+ end_access %4 : $*X
562
+ %10 = tuple ()
563
+ return %10 : $()
564
+ }
565
+
566
+ // public func testOptOnNestedDomRead() {
567
+ // Checks that we bail when the dominated begin comes before the dominating begin
568
+ //
569
+ // CHECK-LABEL: sil @testOptOnNestedDomRead : $@convention(thin) () -> () {
570
+ // CHECK: bb0:
571
+ // CHECK: [[GLOBAL:%.*]] = global_addr @globalX : $*X
572
+ // CHECK: [[BEGIN:%.*]] = begin_access [read] [dynamic] [[GLOBAL]] : $*X
573
+ // CHECK: [[BEGIN2:%.*]] = begin_access [read] [static] [no_nested_conflict] [[GLOBAL]] : $*X
574
+ // CHECK-LABEL: } // end sil function 'testOptOnNestedDomRead'
575
+ sil @testOptOnNestedDomRead : $@convention(thin) () -> () {
576
+ bb0:
577
+ %0 = global_addr @globalX: $*X
578
+ %4 = begin_access [read] [dynamic] %0 : $*X
579
+ %5 = load %4 : $*X
580
+ %7 = begin_access [read] [dynamic] [no_nested_conflict] %0 : $*X
581
+ %8 = load %7 : $*X
582
+ end_access %7 : $*X
583
+ end_access %4 : $*X
584
+ %10 = tuple ()
585
+ return %10 : $()
586
+ }
0 commit comments