summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Clement <clementval@gmail.com>2023-05-10 08:32:55 -0700
committerValentin Clement <clementval@gmail.com>2023-05-10 08:34:25 -0700
commit3484745a5f41c9282712c575229a92b658b23dd1 (patch)
tree77f4189c9338b7c8916e732de91d3a4d539c6a7f
parentb60e49165ee10d11eacfdce9bf9c59d132d95e25 (diff)
downloadllvm-3484745a5f41c9282712c575229a92b658b23dd1.tar.gz
[mlir][openacc] Cleanup acc.serial from old data clause operands
Remove old clause operands from acc.serial operation since the new dataOperands is now in place. private and firstprivate will receive some redesign but are not part of the new dataOperands. Depends on D150207 Reviewed By: vzakhari Differential Revision: https://reviews.llvm.org/D150224
-rw-r--r--flang/lib/Lower/OpenACC.cpp2
-rw-r--r--mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td25
-rw-r--r--mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp8
-rw-r--r--mlir/test/Dialect/OpenACC/ops.mlir28
4 files changed, 2 insertions, 61 deletions
diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index 0980e1c6181b..1fc1c0bc825c 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<Op, mlir::acc::KernelsOp>)
addOperands(operands, operandSegments, reductionOperands);
- if constexpr (!std::is_same_v<Op, mlir::acc::ParallelOp>)
+ if constexpr (std::is_same_v<Op, mlir::acc::KernelsOp>)
operandSegments.append({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0});
if constexpr (!std::is_same_v<Op, mlir::acc::KernelsOp>) {
addOperands(operands, operandSegments, privateOperands);
diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
index c73948550f03..76818639512e 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<OpenACC_ReductionOpAttr>:$reductionOp,
Variadic<AnyType>:$reductionOperands,
- Variadic<AnyType>:$copyOperands,
- Variadic<AnyType>:$copyinOperands,
- Variadic<AnyType>:$copyinReadonlyOperands,
- Variadic<AnyType>:$copyoutOperands,
- Variadic<AnyType>:$copyoutZeroOperands,
- Variadic<AnyType>:$createOperands,
- Variadic<AnyType>:$createZeroOperands,
- Variadic<AnyType>:$noCreateOperands,
- Variadic<AnyType>:$presentOperands,
- Variadic<AnyType>:$devicePtrOperands,
- Variadic<AnyType>:$attachOperands,
Variadic<AnyType>:$gangPrivateOperands,
Variadic<AnyType>:$gangFirstPrivateOperands,
Variadic<OpenACC_PointerLikeTypeInterface>:$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 a69a40d87f93..5760abd60a29 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 b31be94b0da4..b1044f80717b 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 {