|
1 |
| -// RUN: mlir-opt -allow-unregistered-dialect %s -affine-loop-unroll="unroll-full" | FileCheck %s --check-prefix UNROLL-FULL |
2 |
| -// RUN: mlir-opt -allow-unregistered-dialect %s -affine-loop-unroll="unroll-full unroll-full-threshold=2" | FileCheck %s --check-prefix SHORT |
3 |
| -// RUN: mlir-opt -allow-unregistered-dialect %s -affine-loop-unroll="unroll-factor=4" | FileCheck %s --check-prefix UNROLL-BY-4 |
4 |
| -// RUN: mlir-opt -allow-unregistered-dialect %s -affine-loop-unroll="unroll-factor=1" | FileCheck %s --check-prefix UNROLL-BY-1 |
5 |
| -// RUN: mlir-opt -allow-unregistered-dialect %s -affine-loop-unroll="unroll-factor=5 cleanup-unroll=true" | FileCheck %s --check-prefix UNROLL-CLEANUP-LOOP |
| 1 | +// RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline="builtin.module(func.func(affine-loop-unroll{unroll-full=true}))" | FileCheck %s --check-prefix UNROLL-FULL |
| 2 | +// RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline="builtin.module(func.func(affine-loop-unroll{unroll-full=true unroll-full-threshold=2}))" | FileCheck %s --check-prefix SHORT |
| 3 | +// RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline="builtin.module(func.func(affine-loop-unroll{unroll-factor=4}))" | FileCheck %s --check-prefix UNROLL-BY-4 |
| 4 | +// RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline="builtin.module(func.func(affine-loop-unroll{unroll-factor=1}))" | FileCheck %s --check-prefix UNROLL-BY-1 |
| 5 | +// RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline="builtin.module(func.func(affine-loop-unroll{unroll-factor=5 cleanup-unroll=true}))" | FileCheck %s --check-prefix UNROLL-CLEANUP-LOOP |
| 6 | +// RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline="builtin.module(gpu.module(gpu.func(affine-loop-unroll{unroll-full=true})))" | FileCheck %s --check-prefix GPU-UNROLL-FULL |
6 | 7 |
|
7 | 8 | // UNROLL-FULL-DAG: [[$MAP0:#map[0-9]*]] = affine_map<(d0) -> (d0 + 1)>
|
8 | 9 | // UNROLL-FULL-DAG: [[$MAP1:#map[0-9]*]] = affine_map<(d0) -> (d0 + 2)>
|
@@ -240,6 +241,23 @@ func.func @loop_nest_unroll_full() {
|
240 | 241 | return
|
241 | 242 | } // UNROLL-FULL }
|
242 | 243 |
|
| 244 | +gpu.module @unroll_full { |
| 245 | + // GPU-UNROLL-FULL-LABEL: func @gpu_loop_nest_simplest() { |
| 246 | + gpu.func @gpu_loop_nest_simplest() { |
| 247 | + // GPU-UNROLL-FULL: affine.for %arg0 = 0 to 100 step 2 { |
| 248 | + affine.for %i = 0 to 100 step 2 { |
| 249 | + // GPU-UNROLL-FULL: %c1_i32 = arith.constant 1 : i32 |
| 250 | + // GPU-UNROLL-FULL-NEXT: %c1_i32_0 = arith.constant 1 : i32 |
| 251 | + // GPU-UNROLL-FULL-NEXT: %c1_i32_1 = arith.constant 1 : i32 |
| 252 | + // GPU-UNROLL-FULL-NEXT: %c1_i32_2 = arith.constant 1 : i32 |
| 253 | + affine.for %j = 0 to 4 { |
| 254 | + %x = arith.constant 1 : i32 |
| 255 | + } |
| 256 | + } // GPU-UNROLL-FULL: } |
| 257 | + gpu.return // GPU-UNROLL-FULL: return |
| 258 | + } |
| 259 | +} |
| 260 | + |
243 | 261 | // SHORT-LABEL: func @loop_nest_outer_unroll() {
|
244 | 262 | func.func @loop_nest_outer_unroll() {
|
245 | 263 | // SHORT: affine.for %arg0 = 0 to 4 {
|
|
0 commit comments