diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp index 0980e1c6181b6..1fc1c0bc825c3 100644 --- a/flang/lib/Lower/OpenACC.cpp +++ b/flang/lib/Lower/OpenACC.cpp @@ -999,7 +999,7 @@ createComputeOp(Fortran::lower::AbstractConverter &converter, addOperand(operands, operandSegments, selfCond); if constexpr (!std::is_same_v) addOperands(operands, operandSegments, reductionOperands); - if constexpr (!std::is_same_v) + 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, privateOperands); diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td index c73948550f03e..76818639512ea 100644 --- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td @@ -485,17 +485,6 @@ def OpenACC_SerialOp : OpenACC_Op<"serial", UnitAttr:$selfAttr, OptionalAttr:$reductionOp, Variadic:$reductionOperands, - Variadic:$copyOperands, - Variadic:$copyinOperands, - Variadic:$copyinReadonlyOperands, - Variadic:$copyoutOperands, - Variadic:$copyoutZeroOperands, - Variadic:$createOperands, - Variadic:$createZeroOperands, - Variadic:$noCreateOperands, - Variadic:$presentOperands, - Variadic:$devicePtrOperands, - Variadic:$attachOperands, Variadic:$gangPrivateOperands, Variadic:$gangFirstPrivateOperands, Variadic:$dataClauseOperands, @@ -514,24 +503,10 @@ def OpenACC_SerialOp : OpenACC_Op<"serial", 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) `)` | `firstprivate` `(` $gangFirstPrivateOperands `:` type($gangFirstPrivateOperands) `)` - | `no_create` `(` $noCreateOperands `:` type($noCreateOperands) `)` | `private` `(` $gangPrivateOperands `:` type($gangPrivateOperands) `)` - | `present` `(` $presentOperands `:` type($presentOperands) `)` | `wait` `(` $waitOperands `:` type($waitOperands) `)` | `self` `(` $selfCond `)` | `if` `(` $ifCond `)` diff --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp index a69a40d87f93f..5760abd60a296 100644 --- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp +++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp @@ -325,13 +325,7 @@ LogicalResult acc::ParallelOp::verify() { //===----------------------------------------------------------------------===// unsigned SerialOp::getNumDataOperands() { - return getReductionOperands().size() + getCopyOperands().size() + - getCopyinOperands().size() + getCopyinReadonlyOperands().size() + - getCopyoutOperands().size() + getCopyoutZeroOperands().size() + - getCreateOperands().size() + getCreateZeroOperands().size() + - getNoCreateOperands().size() + getPresentOperands().size() + - getDevicePtrOperands().size() + getAttachOperands().size() + - getGangPrivateOperands().size() + + return getReductionOperands().size() + getGangPrivateOperands().size() + getGangFirstPrivateOperands().size() + getDataClauseOperands().size(); } diff --git a/mlir/test/Dialect/OpenACC/ops.mlir b/mlir/test/Dialect/OpenACC/ops.mlir index b31be94b0da48..b1044f80717b5 100644 --- a/mlir/test/Dialect/OpenACC/ops.mlir +++ b/mlir/test/Dialect/OpenACC/ops.mlir @@ -480,20 +480,6 @@ func.func @testserialop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10 } acc.serial wait(%i64value, %i32value, %idxValue : i64, i32, index) { } - acc.serial copyin(%a, %b : memref<10xf32>, memref<10xf32>) { - } - acc.serial copyin_readonly(%a, %b : memref<10xf32>, memref<10xf32>) { - } - acc.serial copyin(%a: memref<10xf32>) copyout_zero(%b, %c : memref<10xf32>, memref<10x10xf32>) { - } - acc.serial copyout(%b, %c : memref<10xf32>, memref<10x10xf32>) create(%a: memref<10xf32>) { - } - acc.serial copyout_zero(%b, %c : memref<10xf32>, memref<10x10xf32>) create_zero(%a: memref<10xf32>) { - } - acc.serial no_create(%a: memref<10xf32>) present(%b, %c : memref<10xf32>, memref<10x10xf32>) { - } - acc.serial deviceptr(%a: memref<10xf32>) attach(%b, %c : memref<10xf32>, memref<10x10xf32>) { - } acc.serial private(%a, %c : memref<10xf32>, memref<10x10xf32>) firstprivate(%b: memref<10xf32>) { } acc.serial { @@ -530,20 +516,6 @@ func.func @testserialop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10 // CHECK-NEXT: } // CHECK: acc.serial wait([[I64VALUE]], [[I32VALUE]], [[IDXVALUE]] : i64, i32, index) { // CHECK-NEXT: } -// CHECK: acc.serial copyin([[ARGA]], [[ARGB]] : memref<10xf32>, memref<10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.serial copyin_readonly([[ARGA]], [[ARGB]] : memref<10xf32>, memref<10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.serial copyin([[ARGA]] : memref<10xf32>) copyout_zero([[ARGB]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.serial copyout([[ARGB]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) create([[ARGA]] : memref<10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.serial copyout_zero([[ARGB]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) create_zero([[ARGA]] : memref<10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.serial no_create([[ARGA]] : memref<10xf32>) present([[ARGB]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) { -// CHECK-NEXT: } -// CHECK: acc.serial attach([[ARGB]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) deviceptr([[ARGA]] : memref<10xf32>) { -// CHECK-NEXT: } // CHECK: acc.serial firstprivate([[ARGB]] : memref<10xf32>) private([[ARGA]], [[ARGC]] : memref<10xf32>, memref<10x10xf32>) { // CHECK-NEXT: } // CHECK: acc.serial {