diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp index 1fc1c0bc825c3..fb6b71466021b 100644 --- a/flang/lib/Lower/OpenACC.cpp +++ b/flang/lib/Lower/OpenACC.cpp @@ -997,11 +997,8 @@ createComputeOp(Fortran::lower::AbstractConverter &converter, } addOperand(operands, operandSegments, ifCond); addOperand(operands, operandSegments, selfCond); - if constexpr (!std::is_same_v) - addOperands(operands, operandSegments, reductionOperands); - if constexpr (std::is_same_v) - operandSegments.append({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}); if constexpr (!std::is_same_v) { + addOperands(operands, operandSegments, reductionOperands); addOperands(operands, operandSegments, privateOperands); addOperands(operands, operandSegments, firstprivateOperands); } diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td index 76818639512ea..1479ff10356ca 100644 --- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td @@ -550,17 +550,6 @@ def OpenACC_KernelsOp : OpenACC_Op<"kernels", Optional:$ifCond, Optional:$selfCond, UnitAttr:$selfAttr, - Variadic:$copyOperands, - Variadic:$copyinOperands, - Variadic:$copyinReadonlyOperands, - Variadic:$copyoutOperands, - Variadic:$copyoutZeroOperands, - Variadic:$createOperands, - Variadic:$createZeroOperands, - Variadic:$noCreateOperands, - Variadic:$presentOperands, - Variadic:$devicePtrOperands, - Variadic:$attachOperands, Variadic:$dataClauseOperands, OptionalAttr:$defaultAttr); @@ -577,22 +566,9 @@ def OpenACC_KernelsOp : OpenACC_Op<"kernels", let assemblyFormat = [{ oilist( `dataOperands` `(` $dataClauseOperands `:` type($dataClauseOperands) `)` - | `attach` `(` $attachOperands `:` type($attachOperands) `)` | `async` `(` $async `:` type($async) `)` - | `copy` `(` $copyOperands `:` type($copyOperands) `)` - | `copyin` `(` $copyinOperands `:` type($copyinOperands) `)` - | `copyin_readonly` `(` $copyinReadonlyOperands `:` - type($copyinReadonlyOperands) `)` - | `copyout` `(` $copyoutOperands `:` type($copyoutOperands) `)` - | `copyout_zero` `(` $copyoutZeroOperands `:` - type($copyoutZeroOperands) `)` - | `create` `(` $createOperands `:` type($createOperands) `)` - | `create_zero` `(` $createZeroOperands `:` type($createZeroOperands) `)` - | `deviceptr` `(` $devicePtrOperands `:` type($devicePtrOperands) `)` - | `no_create` `(` $noCreateOperands `:` type($noCreateOperands) `)` | `num_gangs` `(` $numGangs `:` type($numGangs) `)` | `num_workers` `(` $numWorkers `:` type($numWorkers) `)` - | `present` `(` $presentOperands `:` type($presentOperands) `)` | `vector_length` `(` $vectorLength `:` type($vectorLength) `)` | `wait` `(` $waitOperands `:` type($waitOperands) `)` | `self` `(` $selfCond `)` diff --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp index 5760abd60a296..f92b040109334 100644 --- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp +++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp @@ -345,12 +345,7 @@ LogicalResult acc::SerialOp::verify() { //===----------------------------------------------------------------------===// unsigned KernelsOp::getNumDataOperands() { - return getCopyOperands().size() + getCopyinOperands().size() + - getCopyinReadonlyOperands().size() + getCopyoutOperands().size() + - getCopyoutZeroOperands().size() + getCreateOperands().size() + - getCreateZeroOperands().size() + getNoCreateOperands().size() + - getPresentOperands().size() + getDevicePtrOperands().size() + - getAttachOperands().size() + getDataClauseOperands().size(); + return getDataClauseOperands().size(); } Value KernelsOp::getDataOperand(unsigned i) { diff --git a/mlir/test/Dialect/OpenACC/ops.mlir b/mlir/test/Dialect/OpenACC/ops.mlir index b1044f80717b5..7260c05d3aaeb 100644 --- a/mlir/test/Dialect/OpenACC/ops.mlir +++ b/mlir/test/Dialect/OpenACC/ops.mlir @@ -553,20 +553,6 @@ func.func @testserialop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10 } acc.kernels wait(%i64value, %i32value, %idxValue : i64, i32, index) { } - acc.kernels copyin(%a, %b : memref<10xf32>, memref<10xf32>) { - } - acc.kernels copyin_readonly(%a, %b : memref<10xf32>, memref<10xf32>) { - } - acc.kernels copyin(%a: memref<10xf32>) copyout_zero(%b, %c : memref<10xf32>, memref<10x10xf32>) { - } - acc.kernels copyout(%b, %c : memref<10xf32>, memref<10x10xf32>) create(%a: memref<10xf32>) { - } - acc.kernels copyout_zero(%b, %c : memref<10xf32>, memref<10x10xf32>) create_zero(%a: memref<10xf32>) { - } - acc.kernels no_create(%a: memref<10xf32>) present(%b, %c : memref<10xf32>, memref<10x10xf32>) { - } - acc.kernels deviceptr(%a: memref<10xf32>) attach(%b, %c : memref<10xf32>, memref<10x10xf32>) { - } acc.kernels { } attributes {defaultAttr = #acc} acc.kernels { @@ -601,20 +587,6 @@ func.func @testserialop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10 // CHECK-NEXT: } // CHECK: acc.kernels wait([[I64VALUE]], [[I32VALUE]], [[IDXVALUE]] : i64, i32, index) { // CHECK-NEXT: } -// CHECK: acc.kernels copyin([[ARGA]], [[ARGB]] : memref<10xf32>, memref<10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.kernels copyin_readonly([[ARGA]], [[ARGB]] : memref<10xf32>, memref<10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.kernels copyin([[ARGA]] : memref<10xf32>) copyout_zero([[ARGB]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.kernels copyout([[ARGB]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) create([[ARGA]] : memref<10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.kernels copyout_zero([[ARGB]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) create_zero([[ARGA]] : memref<10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.kernels no_create([[ARGA]] : memref<10xf32>) present([[ARGB]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.kernels attach([[ARGB]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) deviceptr([[ARGA]] : memref<10xf32>) { -// CHECK-NEXT: } // CHECK: acc.kernels { // CHECK-NEXT: } attributes {defaultAttr = #acc} // CHECK: acc.kernels {