annotate mlir/test/Analysis/test-alias-analysis.mlir @ 227:21e6aa2e49ef

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 19 Jul 2021 06:57:16 +0900
parents 2e18cbf3894f
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 // RUN: mlir-opt %s -pass-pipeline='func(test-alias-analysis)' -split-input-file -allow-unregistered-dialect 2>&1 | FileCheck %s
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 // CHECK-LABEL: Testing : "simple"
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 // CHECK-DAG: func.region0#0 <-> func.region0#1: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 // CHECK-DAG: alloca_1#0 <-> alloca_2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 // CHECK-DAG: alloca_1#0 <-> alloc_1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 // CHECK-DAG: alloca_1#0 <-> alloc_2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 // CHECK-DAG: alloca_1#0 <-> func.region0#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 // CHECK-DAG: alloca_1#0 <-> func.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 // CHECK-DAG: alloca_2#0 <-> alloc_1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 // CHECK-DAG: alloca_2#0 <-> alloc_2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 // CHECK-DAG: alloca_2#0 <-> func.region0#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 // CHECK-DAG: alloca_2#0 <-> func.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 // CHECK-DAG: alloc_1#0 <-> alloc_2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 // CHECK-DAG: alloc_1#0 <-> func.region0#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 // CHECK-DAG: alloc_1#0 <-> func.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 // CHECK-DAG: alloc_2#0 <-> func.region0#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 // CHECK-DAG: alloc_2#0 <-> func.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 func @simple(%arg: memref<2xf32>, %arg1: memref<2xf32>) attributes {test.ptr = "func"} {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 %0 = memref.alloca() {test.ptr = "alloca_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 %1 = memref.alloca() {test.ptr = "alloca_2"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 %2 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 %3 = memref.alloc() {test.ptr = "alloc_2"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 return
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 // -----
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 // CHECK-LABEL: Testing : "control_flow"
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 // CHECK-DAG: alloca_1#0 <-> func.region0.block1#0: MustAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 // CHECK-DAG: alloca_1#0 <-> func.region0.block2#0: MustAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 // CHECK-DAG: alloca_2#0 <-> func.region0.block1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 // CHECK-DAG: alloca_2#0 <-> func.region0.block2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 // CHECK-DAG: alloc_1#0 <-> func.region0.block1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 // CHECK-DAG: alloc_1#0 <-> func.region0.block2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 // CHECK-DAG: func.region0#0 <-> func.region0.block1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 // CHECK-DAG: func.region0#0 <-> func.region0.block2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 // CHECK-DAG: func.region0#1 <-> func.region0.block1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 // CHECK-DAG: func.region0#1 <-> func.region0.block2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 // CHECK-DAG: func.region0.block1#0 <-> func.region0.block2#0: MustAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 func @control_flow(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr = "func"} {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 %0 = memref.alloca() {test.ptr = "alloca_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 %1 = memref.alloca() {test.ptr = "alloca_2"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 %2 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 cond_br %cond, ^bb1(%0 : memref<8x64xf32>), ^bb2(%0 : memref<8x64xf32>)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 ^bb1(%arg1: memref<8x64xf32>):
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 br ^bb2(%arg1 : memref<8x64xf32>)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 ^bb2(%arg2: memref<8x64xf32>):
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 return
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 // -----
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 // CHECK-LABEL: Testing : "control_flow_merge"
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 // CHECK-DAG: alloca_1#0 <-> func.region0.block1#0: MustAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 // CHECK-DAG: alloca_1#0 <-> func.region0.block2#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 // CHECK-DAG: alloca_2#0 <-> func.region0.block1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 // CHECK-DAG: alloca_2#0 <-> func.region0.block2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 // CHECK-DAG: alloc_1#0 <-> func.region0.block1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 // CHECK-DAG: alloc_1#0 <-> func.region0.block2#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 // CHECK-DAG: func.region0#0 <-> func.region0.block1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 // CHECK-DAG: func.region0#0 <-> func.region0.block2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 // CHECK-DAG: func.region0#1 <-> func.region0.block1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 // CHECK-DAG: func.region0#1 <-> func.region0.block2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 // CHECK-DAG: func.region0.block1#0 <-> func.region0.block2#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 func @control_flow_merge(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr = "func"} {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 %0 = memref.alloca() {test.ptr = "alloca_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 %1 = memref.alloca() {test.ptr = "alloca_2"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 %2 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 cond_br %cond, ^bb1(%0 : memref<8x64xf32>), ^bb2(%2 : memref<8x64xf32>)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 ^bb1(%arg1: memref<8x64xf32>):
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 br ^bb2(%arg1 : memref<8x64xf32>)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 ^bb2(%arg2: memref<8x64xf32>):
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 return
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 // -----
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
98
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 // CHECK-LABEL: Testing : "region_control_flow"
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 // CHECK-DAG: alloca_1#0 <-> if_alloca#0: MustAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 // CHECK-DAG: alloca_1#0 <-> if_alloca_merge#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 // CHECK-DAG: alloca_1#0 <-> if_alloc#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
103
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 // CHECK-DAG: alloca_2#0 <-> if_alloca#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 // CHECK-DAG: alloca_2#0 <-> if_alloca_merge#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
106 // CHECK-DAG: alloca_2#0 <-> if_alloc#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
107
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 // CHECK-DAG: alloc_1#0 <-> if_alloca#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 // CHECK-DAG: alloc_1#0 <-> if_alloca_merge#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 // CHECK-DAG: alloc_1#0 <-> if_alloc#0: MustAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 // CHECK-DAG: if_alloca#0 <-> if_alloca_merge#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 // CHECK-DAG: if_alloca#0 <-> if_alloc#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 // CHECK-DAG: if_alloca#0 <-> func.region0#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 // CHECK-DAG: if_alloca#0 <-> func.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 // CHECK-DAG: if_alloca_merge#0 <-> if_alloc#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 // CHECK-DAG: if_alloca_merge#0 <-> func.region0#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 // CHECK-DAG: if_alloca_merge#0 <-> func.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 // CHECK-DAG: if_alloc#0 <-> func.region0#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 // CHECK-DAG: if_alloc#0 <-> func.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 func @region_control_flow(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr = "func"} {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 %0 = memref.alloca() {test.ptr = "alloca_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 %1 = memref.alloca() {test.ptr = "alloca_2"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 %2 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 %3 = scf.if %cond -> (memref<8x64xf32>) {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 scf.yield %0 : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 } else {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 scf.yield %0 : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 } {test.ptr = "if_alloca"}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 %4 = scf.if %cond -> (memref<8x64xf32>) {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 scf.yield %0 : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 } else {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 scf.yield %1 : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 } {test.ptr = "if_alloca_merge"}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
139
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 %5 = scf.if %cond -> (memref<8x64xf32>) {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 scf.yield %2 : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 } else {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 scf.yield %2 : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 } {test.ptr = "if_alloc"}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 return
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
147
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 // -----
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
149
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
150 // CHECK-LABEL: Testing : "region_loop_control_flow"
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 // CHECK-DAG: alloca_1#0 <-> for_alloca#0: MustAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 // CHECK-DAG: alloca_1#0 <-> for_alloca.region0#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 // CHECK-DAG: alloca_1#0 <-> for_alloca.region0#1: MustAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
154
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 // CHECK-DAG: alloca_2#0 <-> for_alloca#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 // CHECK-DAG: alloca_2#0 <-> for_alloca.region0#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 // CHECK-DAG: alloca_2#0 <-> for_alloca.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
158
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 // CHECK-DAG: alloc_1#0 <-> for_alloca#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 // CHECK-DAG: alloc_1#0 <-> for_alloca.region0#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 // CHECK-DAG: alloc_1#0 <-> for_alloca.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
162
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 // CHECK-DAG: for_alloca#0 <-> for_alloca.region0#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 // CHECK-DAG: for_alloca#0 <-> for_alloca.region0#1: MustAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 // CHECK-DAG: for_alloca#0 <-> func.region0#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 // CHECK-DAG: for_alloca#0 <-> func.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 // CHECK-DAG: for_alloca#0 <-> func.region0#2: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 // CHECK-DAG: for_alloca#0 <-> func.region0#3: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
169
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 // CHECK-DAG: for_alloca.region0#0 <-> for_alloca.region0#1: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 // CHECK-DAG: for_alloca.region0#0 <-> func.region0#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 // CHECK-DAG: for_alloca.region0#0 <-> func.region0#1: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 // CHECK-DAG: for_alloca.region0#0 <-> func.region0#2: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 // CHECK-DAG: for_alloca.region0#0 <-> func.region0#3: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
175
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 // CHECK-DAG: for_alloca.region0#1 <-> func.region0#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 // CHECK-DAG: for_alloca.region0#1 <-> func.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 // CHECK-DAG: for_alloca.region0#1 <-> func.region0#2: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 // CHECK-DAG: for_alloca.region0#1 <-> func.region0#3: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 func @region_loop_control_flow(%arg: memref<2xf32>, %loopI0 : index,
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 %loopI1 : index, %loopI2 : index) attributes {test.ptr = "func"} {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 %0 = memref.alloca() {test.ptr = "alloca_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 %1 = memref.alloca() {test.ptr = "alloca_2"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 %2 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
185
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 %result = scf.for %i0 = %loopI0 to %loopI1 step %loopI2 iter_args(%si = %0) -> (memref<8x64xf32>) {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 scf.yield %si : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 } {test.ptr = "for_alloca"}
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 return
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
191
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 // -----
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
193
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 // CHECK-LABEL: Testing : "view_like"
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 // CHECK-DAG: alloc_1#0 <-> view#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
196
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 // CHECK-DAG: alloca_1#0 <-> view#0: MustAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
198
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
199 // CHECK-DAG: view#0 <-> func.region0#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 // CHECK-DAG: view#0 <-> func.region0#1: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 func @view_like(%arg: memref<2xf32>, %size: index) attributes {test.ptr = "func"} {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 %1 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
203
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
204 %c0 = constant 0 : index
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 %2 = memref.alloca (%size) {test.ptr = "alloca_1"} : memref<?xi8>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 %3 = memref.view %2[%c0][] {test.ptr = "view"} : memref<?xi8> to memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
207 return
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 }
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
209
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 // -----
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
211
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 // CHECK-LABEL: Testing : "constants"
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 // CHECK-DAG: alloc_1#0 <-> constant_1#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 // CHECK-DAG: alloc_1#0 <-> constant_2#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 // CHECK-DAG: alloc_1#0 <-> constant_3#0: NoAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
216
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 // CHECK-DAG: constant_1#0 <-> constant_2#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 // CHECK-DAG: constant_1#0 <-> constant_3#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 // CHECK-DAG: constant_1#0 <-> func.region0#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
220
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 // CHECK-DAG: constant_2#0 <-> constant_3#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 // CHECK-DAG: constant_2#0 <-> func.region0#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
223
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 // CHECK-DAG: constant_3#0 <-> func.region0#0: MayAlias
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 func @constants(%arg: memref<2xf32>) attributes {test.ptr = "func"} {
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 %1 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
227
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 %c0 = constant {test.ptr = "constant_1"} 0 : index
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 %c0_2 = constant {test.ptr = "constant_2"} 0 : index
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 %c1 = constant {test.ptr = "constant_3"} 1 : index
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
231
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 return
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 }