xref: /llvm-project/mlir/test/Conversion/SCFToSPIRV/unsupported.mlir (revision 10056c821a56a19cef732129e4e0c5883ae1ee49)
1// RUN: mlir-opt -convert-scf-to-spirv %s -o - | FileCheck %s
2
3// `scf.parallel` conversion is not supported yet.
4// Make sure that we do not accidentally invalidate this function by removing
5// `scf.reduce`.
6// CHECK-LABEL: func.func @func
7// CHECK:         scf.parallel
8// CHECK-NEXT:      spirv.Constant
9// CHECK-NEXT:      memref.store
10// CHECK-NEXT:      scf.reduce
11// CHECK:         spirv.Return
12func.func @func(%arg0: i64) {
13  %0 = arith.index_cast %arg0 : i64 to index
14  %alloc = memref.alloc() : memref<16xf32>
15  scf.parallel (%arg1) = (%0) to (%0) step (%0) {
16    %cst = arith.constant 1.000000e+00 : f32
17    memref.store %cst, %alloc[%arg1] : memref<16xf32>
18    scf.reduce
19  }
20  return
21}
22