brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 4f59b78 Raw
43 lines · plain
1// RUN: mlir-opt %s -affine-super-vectorizer-test=vectorize-affine-loop-nest -split-input-file 2>&1 |  FileCheck %s2 3func.func @unparallel_loop_reduction_unsupported(%in: memref<256x512xf32>, %out: memref<256xf32>) {4 // CHECK: Outermost loop cannot be parallel5 %cst = arith.constant 1.000000e+00 : f326 %final_red = affine.for %j = 0 to 512 iter_args(%red_iter = %cst) -> (f32) {7   %add = arith.addf %red_iter, %red_iter : f328   affine.yield %add : f329 }10 return11}12 13// -----14 15#map = affine_map<(d0)[s0] -> (d0 mod s0)>16#map1 = affine_map<(d0)[s0] -> (d0 floordiv s0)>17 18func.func @iv_mapped_to_multiple_indices_unsupported(%arg0: index) -> memref<2x2xf32> {19  %c2 = arith.constant 2 : index20  %cst = arith.constant 1.0 : f3221  %alloc = memref.alloc() : memref<2x2xf32>22    23    affine.for %i = 0 to 4 {24      %row = affine.apply #map1(%i)[%c2]  25      %col = affine.apply #map(%i)[%c2]  26      affine.store %cst, %alloc[%row, %col] : memref<2x2xf32>27    }28    29    return %alloc : memref<2x2xf32>30  }31 32// CHECK: #[[$ATTR_0:.+]] = affine_map<(d0)[s0] -> (d0 floordiv s0)>33// CHECK: #[[$ATTR_1:.+]] = affine_map<(d0)[s0] -> (d0 mod s0)>34 35// CHECK-LABEL:   func.func @iv_mapped_to_multiple_indices_unsupported(36// CHECK-SAME:      %[[VAL_0:.*]]: index) -> memref<2x2xf32> {37// CHECK:           %[[VAL_1:.*]] = arith.constant 2 : index38// CHECK:           affine.for %[[VAL_4:.*]] = 0 to 4 {39// CHECK:             %[[VAL_5:.*]] = affine.apply #[[$ATTR_0]](%[[VAL_4]]){{\[}}%[[VAL_1]]]40// CHECK:             %[[VAL_6:.*]] = affine.apply #[[$ATTR_1]](%[[VAL_4]]){{\[}}%[[VAL_1]]]41// CHECK:           }42// CHECK:         }43