• Home
  • Raw
  • Download

Lines Matching refs:FULL

1 …unregistered-dialect %s -affine-loop-unroll="unroll-full" | FileCheck %s --check-prefix UNROLL-FULL
6 // UNROLL-FULL-DAG: [[$MAP0:#map[0-9]+]] = affine_map<(d0) -> (d0 + 1)>
7 // UNROLL-FULL-DAG: [[$MAP1:#map[0-9]+]] = affine_map<(d0) -> (d0 + 2)>
8 // UNROLL-FULL-DAG: [[$MAP2:#map[0-9]+]] = affine_map<(d0) -> (d0 + 3)>
9 // UNROLL-FULL-DAG: [[$MAP3:#map[0-9]+]] = affine_map<(d0) -> (d0 + 4)>
10 // UNROLL-FULL-DAG: [[$MAP4:#map[0-9]+]] = affine_map<(d0, d1) -> (d0 + 1)>
11 // UNROLL-FULL-DAG: [[$MAP5:#map[0-9]+]] = affine_map<(d0, d1) -> (d0 + 3)>
12 // UNROLL-FULL-DAG: [[$MAP6:#map[0-9]+]] = affine_map<(d0)[s0] -> (d0 + s0 + 1)>
26 // UNROLL-FULL-LABEL: func @loop_nest_simplest() {
28 // UNROLL-FULL: affine.for %arg0 = 0 to 100 step 2 {
30 // UNROLL-FULL: %c1_i32 = constant 1 : i32
31 // UNROLL-FULL-NEXT: %c1_i32_0 = constant 1 : i32
32 // UNROLL-FULL-NEXT: %c1_i32_1 = constant 1 : i32
33 // UNROLL-FULL-NEXT: %c1_i32_2 = constant 1 : i32
37 } // UNROLL-FULL: }
38 return // UNROLL-FULL: return
39 } // UNROLL-FULL }
41 // UNROLL-FULL-LABEL: func @loop_nest_simple_iv_use() {
43 // UNROLL-FULL: %c0 = constant 0 : index
44 // UNROLL-FULL-NEXT: affine.for %arg0 = 0 to 100 step 2 {
46 // UNROLL-FULL: %0 = "addi32"(%c0, %c0) : (index, index) -> i32
47 // UNROLL-FULL: %1 = affine.apply [[$MAP0]](%c0)
48 // UNROLL-FULL-NEXT: %2 = "addi32"(%1, %1) : (index, index) -> i32
49 // UNROLL-FULL: %3 = affine.apply [[$MAP1]](%c0)
50 // UNROLL-FULL-NEXT: %4 = "addi32"(%3, %3) : (index, index) -> i32
51 // UNROLL-FULL: %5 = affine.apply [[$MAP2]](%c0)
52 // UNROLL-FULL-NEXT: %6 = "addi32"(%5, %5) : (index, index) -> i32
56 } // UNROLL-FULL: }
57 return // UNROLL-FULL: return
58 } // UNROLL-FULL }
61 // UNROLL-FULL-LABEL: func @loop_nest_body_def_use() {
63 // UNROLL-FULL: %c0 = constant 0 : index
64 // UNROLL-FULL-NEXT: affine.for %arg0 = 0 to 100 step 2 {
66 // UNROLL-FULL: %c0_0 = constant 0 : index
68 // UNROLL-FULL: %0 = affine.apply [[$MAP0]](%c0)
69 // UNROLL-FULL-NEXT: %1 = "addi32"(%0, %c0_0) : (index, index) -> index
70 // UNROLL-FULL-NEXT: %2 = affine.apply [[$MAP0]](%c0)
71 // UNROLL-FULL-NEXT: %3 = affine.apply [[$MAP0]](%2)
72 // UNROLL-FULL-NEXT: %4 = "addi32"(%3, %c0_0) : (index, index) -> index
73 // UNROLL-FULL-NEXT: %5 = affine.apply [[$MAP1]](%c0)
74 // UNROLL-FULL-NEXT: %6 = affine.apply [[$MAP0]](%5)
75 // UNROLL-FULL-NEXT: %7 = "addi32"(%6, %c0_0) : (index, index) -> index
76 // UNROLL-FULL-NEXT: %8 = affine.apply [[$MAP2]](%c0)
77 // UNROLL-FULL-NEXT: %9 = affine.apply [[$MAP0]](%8)
78 // UNROLL-FULL-NEXT: %10 = "addi32"(%9, %c0_0) : (index, index) -> index
84 } // UNROLL-FULL: }
85 return // UNROLL-FULL: return
86 } // UNROLL-FULL }
88 // UNROLL-FULL-LABEL: func @loop_nest_strided() {
90 // UNROLL-FULL: %c2 = constant 2 : index
91 // UNROLL-FULL-NEXT: %c2_0 = constant 2 : index
92 // UNROLL-FULL-NEXT: affine.for %arg0 = 0 to 100 {
94 // UNROLL-FULL: %0 = affine.apply [[$MAP0]](%c2_0)
95 // UNROLL-FULL-NEXT: %1 = "addi32"(%0, %0) : (index, index) -> index
96 // UNROLL-FULL-NEXT: %2 = affine.apply [[$MAP1]](%c2_0)
97 // UNROLL-FULL-NEXT: %3 = affine.apply [[$MAP0]](%2)
98 // UNROLL-FULL-NEXT: %4 = "addi32"(%3, %3) : (index, index) -> index
104 // UNROLL-FULL: %5 = affine.apply [[$MAP0]](%c2)
105 // UNROLL-FULL-NEXT: %6 = "addi32"(%5, %5) : (index, index) -> index
106 // UNROLL-FULL-NEXT: %7 = affine.apply [[$MAP1]](%c2)
107 // UNROLL-FULL-NEXT: %8 = affine.apply [[$MAP0]](%7)
108 // UNROLL-FULL-NEXT: %9 = "addi32"(%8, %8) : (index, index) -> index
109 // UNROLL-FULL-NEXT: %10 = affine.apply [[$MAP3]](%c2)
110 // UNROLL-FULL-NEXT: %11 = affine.apply [[$MAP0]](%10)
111 // UNROLL-FULL-NEXT: %12 = "addi32"(%11, %11) : (index, index) -> index
117 } // UNROLL-FULL: }
118 return // UNROLL-FULL: return
119 } // UNROLL-FULL }
121 // UNROLL-FULL-LABEL: func @loop_nest_multiple_results() {
123 // UNROLL-FULL: %c0 = constant 0 : index
124 // UNROLL-FULL-NEXT: affine.for %arg0 = 0 to 100 {
126 // UNROLL-FULL: %0 = affine.apply [[$MAP4]](%arg0, %c0)
127 // UNROLL-FULL-NEXT: %1 = "addi32"(%0, %0) : (index, index) -> index
128 // UNROLL-FULL-NEXT: %2 = affine.apply #map{{.*}}(%arg0, %c0)
129 // UNROLL-FULL-NEXT: %3:2 = "fma"(%2, %0, %0) : (index, index, index) -> (index, index)
130 // UNROLL-FULL-NEXT: %4 = affine.apply #map{{.*}}(%c0)
131 // UNROLL-FULL-NEXT: %5 = affine.apply #map{{.*}}(%arg0, %4)
132 // UNROLL-FULL-NEXT: %6 = "addi32"(%5, %5) : (index, index) -> index
133 // UNROLL-FULL-NEXT: %7 = affine.apply #map{{.*}}(%arg0, %4)
134 // UNROLL-FULL-NEXT: %8:2 = "fma"(%7, %5, %5) : (index, index, index) -> (index, index)
141 } // UNROLL-FULL: }
142 return // UNROLL-FULL: return
143 } // UNROLL-FULL }
147 // UNROLL-FULL-LABEL: func @loop_nest_seq_imperfect(%arg0: memref<128x128xf32>) {
149 // UNROLL-FULL: %c0 = constant 0 : index
150 // UNROLL-FULL-NEXT: %c128 = constant 128 : index
152 // UNROLL-FULL: affine.for %arg1 = 0 to 100 {
154 // UNROLL-FULL: %0 = "vld"(%arg1) : (index) -> i32
156 // UNROLL-FULL: %1 = affine.apply [[$MAP0]](%c0)
157 // UNROLL-FULL-NEXT: %2 = "vmulf"(%c0, %1) : (index, index) -> index
158 // UNROLL-FULL-NEXT: %3 = "vaddf"(%2, %2) : (index, index) -> index
159 // UNROLL-FULL-NEXT: %4 = affine.apply [[$MAP0]](%c0)
160 // UNROLL-FULL-NEXT: %5 = affine.apply [[$MAP0]](%4)
161 // UNROLL-FULL-NEXT: %6 = "vmulf"(%4, %5) : (index, index) -> index
162 // UNROLL-FULL-NEXT: %7 = "vaddf"(%6, %6) : (index, index) -> index
163 // UNROLL-FULL-NEXT: %8 = affine.apply [[$MAP1]](%c0)
164 // UNROLL-FULL-NEXT: %9 = affine.apply [[$MAP0]](%8)
165 // UNROLL-FULL-NEXT: %10 = "vmulf"(%8, %9) : (index, index) -> index
166 // UNROLL-FULL-NEXT: %11 = "vaddf"(%10, %10) : (index, index) -> index
167 // UNROLL-FULL-NEXT: %12 = affine.apply [[$MAP2]](%c0)
168 // UNROLL-FULL-NEXT: %13 = affine.apply [[$MAP0]](%12)
169 // UNROLL-FULL-NEXT: %14 = "vmulf"(%12, %13) : (index, index) -> index
170 // UNROLL-FULL-NEXT: %15 = "vaddf"(%14, %14) : (index, index) -> index
177 // UNROLL-FULL: %16 = "scale"(%c128, %arg1) : (index, index) -> index
179 // UNROLL-FULL: "vst"(%16, %arg1) : (index, index) -> ()
181 } // UNROLL-FULL }
182 return // UNROLL-FULL: return
185 // UNROLL-FULL-LABEL: func @loop_nest_seq_multiple() {
187 // UNROLL-FULL: c0 = constant 0 : index
188 // UNROLL-FULL-NEXT: %c0_0 = constant 0 : index
189 // UNROLL-FULL-NEXT: %0 = affine.apply [[$MAP0]](%c0_0)
190 // UNROLL-FULL-NEXT: "mul"(%0, %0) : (index, index) -> ()
191 // UNROLL-FULL-NEXT: %1 = affine.apply [[$MAP0]](%c0_0)
192 // UNROLL-FULL-NEXT: %2 = affine.apply [[$MAP0]](%1)
193 // UNROLL-FULL-NEXT: "mul"(%2, %2) : (index, index) -> ()
194 // UNROLL-FULL-NEXT: %3 = affine.apply [[$MAP1]](%c0_0)
195 // UNROLL-FULL-NEXT: %4 = affine.apply [[$MAP0]](%3)
196 // UNROLL-FULL-NEXT: "mul"(%4, %4) : (index, index) -> ()
197 // UNROLL-FULL-NEXT: %5 = affine.apply [[$MAP2]](%c0_0)
198 // UNROLL-FULL-NEXT: %6 = affine.apply [[$MAP0]](%5)
199 // UNROLL-FULL-NEXT: "mul"(%6, %6) : (index, index) -> ()
206 // UNROLL-FULL: %c99 = constant 99 : index
208 // UNROLL-FULL: affine.for %arg0 = 0 to 100 step 2 {
210 // UNROLL-FULL: %7 = affine.apply [[$MAP0]](%c0)
211 // UNROLL-FULL-NEXT: %8 = affine.apply [[$MAP6]](%c0)[%c99]
212 // UNROLL-FULL-NEXT: %9 = affine.apply [[$MAP0]](%c0)
213 // UNROLL-FULL-NEXT: %10 = affine.apply [[$MAP0]](%9)
214 // UNROLL-FULL-NEXT: %11 = affine.apply [[$MAP6]](%9)[%c99]
215 // UNROLL-FULL-NEXT: %12 = affine.apply [[$MAP1]](%c0)
216 // UNROLL-FULL-NEXT: %13 = affine.apply [[$MAP0]](%12)
217 // UNROLL-FULL-NEXT: %14 = affine.apply [[$MAP6]](%12)[%c99]
218 // UNROLL-FULL-NEXT: %15 = affine.apply [[$MAP2]](%c0)
219 // UNROLL-FULL-NEXT: %16 = affine.apply [[$MAP0]](%15)
220 // UNROLL-FULL-NEXT: %17 = affine.apply [[$MAP6]](%15)[%c99]
226 } // UNROLL-FULL }
227 } // UNROLL-FULL }
228 return // UNROLL-FULL: return
229 } // UNROLL-FULL }
231 // UNROLL-FULL-LABEL: func @loop_nest_unroll_full() {
233 // UNROLL-FULL-NEXT: %0 = "foo"() : () -> i32
234 // UNROLL-FULL-NEXT: %1 = "bar"() : () -> i32
235 // UNROLL-FULL-NEXT: return
241 } // UNROLL-FULL }