1
- // RUN: %target-swift-frontend -O -enforce-exclusivity=checked -emit-sil -Xllvm -debug-only=sil-licm -primary-file %s 2>&1 | %FileCheck %s --check-prefix=TEST1
2
- // RUN: %target-swift-frontend -O -enforce-exclusivity=checked -emit-sil -Xllvm -debug-only=sil-licm -primary-file %s 2>&1 | %FileCheck %s --check-prefix=TEST2
1
+ // RUN: %target-swift-frontend -O -enforce-exclusivity=checked -emit-sil -Xllvm -debug-only=sil-licm -primary-file %s 2>&1 | %FileCheck %s --check-prefix=TESTLICM
2
+ // RUN: %target-swift-frontend -O -enforce-exclusivity=checked -emit-sil -Xllvm -debug-only=sil-licm -primary-file %s 2>&1 | %FileCheck %s --check-prefix=TESTLICM2
3
3
// RUN: %target-swift-frontend -O -enforce-exclusivity=checked -emit-sil -primary-file %s | %FileCheck %s --check-prefix=TESTSIL
4
- // RUN: %target-swift-frontend -O -enforce-exclusivity=checked -emit-sil -Xllvm -debug-only=sil-licm -whole-module-optimization %s 2>&1 | %FileCheck %s --check-prefix=TEST3
5
- // RUN: %target-swift-frontend -O -enforce-exclusivity=checked -emit-sil -whole-module-optimization %s | %FileCheck %s --check-prefix=TESTSIL2
4
+ // RUN: %target-swift-frontend -O -enforce-exclusivity=checked -emit-sil -Xllvm -debug-only=sil-licm -whole-module-optimization %s 2>&1 | %FileCheck %s --check-prefix=TESTLICMWMO
5
+ // RUN: %target-swift-frontend -O -enforce-exclusivity=checked -emit-sil -whole-module-optimization %s | %FileCheck %s --check-prefix=TESTSILWMO
6
6
7
7
// REQUIRES: optimized_stdlib,asserts
8
8
// REQUIRES: PTRSIZE=64
9
9
10
- // TEST1 -LABEL: Processing loops in {{.*}}run_ReversedArray{{.*}}
11
- // TEST1 : Hoist and Sink pairs attempt
12
- // TEST1 : Hoisted
13
- // TEST1 : Successfully hosited and sank pair
10
+ // TESTLICM -LABEL: Processing loops in {{.*}}run_ReversedArray{{.*}}
11
+ // TESTLICM : Hoist and Sink pairs attempt
12
+ // TESTLICM : Hoisted
13
+ // TESTLICM : Successfully hoisted and sank pair
14
14
15
15
// TESTSIL-LABEL: sil hidden @$s16licm_exclusivity17run_ReversedArrayyySiF : $@convention(thin) (Int) -> () {
16
16
// TESTSIL: bb
@@ -32,9 +32,9 @@ func run_ReversedArray(_ N: Int) {
32
32
}
33
33
}
34
34
35
- // TEST2 -LABEL: Processing loops in {{.*}}count_unicodeScalars{{.*}}
36
- // TEST2 : Hoist and Sink pairs attempt
37
- // TEST2 : Hoisted
35
+ // TESTLICM2 -LABEL: Processing loops in {{.*}}count_unicodeScalars{{.*}}
36
+ // TESTLICM2 : Hoist and Sink pairs attempt
37
+ // TESTLICM2 : Hoisted
38
38
39
39
// TESTSIL-LABEL: sil @$s16licm_exclusivity20count_unicodeScalarsyySS17UnicodeScalarViewVF : $@convention(thin) (@guaranteed String.UnicodeScalarView) -> () {
40
40
// TESTSIL: bb0(%0 : $String.UnicodeScalarView)
@@ -52,34 +52,34 @@ public func count_unicodeScalars(_ s: String.UnicodeScalarView) {
52
52
53
53
54
54
public class ClassWithArrs {
55
- var N : Int = 0
56
- var A : [ Int ]
57
- var B : [ Int ]
55
+ var N : Int = 0
56
+ var A : [ Int ]
57
+ var B : [ Int ]
58
58
59
- init ( N: Int ) {
60
- self . N = N
59
+ init ( N: Int ) {
60
+ self . N = N
61
61
62
- A = [ Int] ( repeating: 0 , count: N)
63
- B = [ Int] ( repeating: 0 , count: N)
64
- }
62
+ A = [ Int] ( repeating: 0 , count: N)
63
+ B = [ Int] ( repeating: 0 , count: N)
64
+ }
65
65
66
- // TEST3-LABEL: Processing loops in {{.*}}ClassWithArrsC7readArr{{.*}}
67
- // TEST3: Hoist and Sink pairs attempt
68
- // TEST3: Hoisted
69
- // TEST3: Successfully hosited and sank pair
70
- // TEST3: Hoisted
71
- // TEST3: Successfully hosited and sank pair
72
- // TESTSIL2-LABEL: sil @$s16licm_exclusivity13ClassWithArrsC7readArryyF : $@convention(method) (@guaranteed ClassWithArrs) -> () {
73
- // TESTSIL2: [[R1:%.*]] = ref_element_addr %0 : $ClassWithArrs, #ClassWithArrs.A
74
- // TESTSIL2: [[R2:%.*]] = ref_element_addr %0 : $ClassWithArrs, #ClassWithArrs.B
75
- // TESTSIL2: begin_access [read] [static] [no_nested_conflict] [[R1]]
76
- // TESTSIL2: begin_access [read] [static] [no_nested_conflict] [[R2]]
77
- public func readArr( ) {
78
- for i in 0 ..< self . N {
79
- for j in 0 ..< i {
80
- let _ = A [ j]
81
- let _ = B [ j]
82
- }
83
- }
66
+ // TESTLICMWMO-LABEL: Processing loops in {{.*}}ClassWithArrsC7readArr{{.*}}
67
+ // TESTLICMWMO: Hoist and Sink pairs attempt
68
+ // TESTLICMWMO: Hoisted
69
+ // TESTLICMWMO: Successfully hoisted and sank pair
70
+ // TESTLICMWMO: Hoisted
71
+ // TESTLICMWMO: Successfully hoisted and sank pair
72
+ // TESTSILWMO-LABEL: sil @$s16licm_exclusivity13ClassWithArrsC7readArryyF : $@convention(method) (@guaranteed ClassWithArrs) -> () {
73
+ // TESTSILWMO: [[R1:%.*]] = ref_element_addr %0 : $ClassWithArrs, #ClassWithArrs.A
74
+ // TESTSILWMO: [[R2:%.*]] = ref_element_addr %0 : $ClassWithArrs, #ClassWithArrs.B
75
+ // TESTSILWMO: begin_access [read] [static] [no_nested_conflict] [[R1]]
76
+ // TESTSILWMO: begin_access [read] [static] [no_nested_conflict] [[R2]]
77
+ public func readArr( ) {
78
+ for i in 0 ..< self . N {
79
+ for j in 0 ..< i {
80
+ let _ = A [ j]
81
+ let _ = B [ j]
82
+ }
84
83
}
84
+ }
85
85
}
0 commit comments