[Mlir-commits] [mlir] 3d2bab1 - [mlir][openacc] Remove detach and delete operands from acc.data

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Sep 27 17:28:20 PDT 2020


Author: Valentin Clement
Date: 2020-09-27T20:28:12-04:00
New Revision: 3d2bab176f528de8d24512e092b2bfb319899b1e

URL: https://github.com/llvm/llvm-project/commit/3d2bab176f528de8d24512e092b2bfb319899b1e
DIFF: https://github.com/llvm/llvm-project/commit/3d2bab176f528de8d24512e092b2bfb319899b1e.diff

LOG: [mlir][openacc] Remove detach and delete operands from acc.data

This patch remove the detach and delete operands. Those operands represent the detach
and delete clauses that will appear in another operation acc.exit_data

Reviewed By: kiranktp, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D88326

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
    mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
    mlir/test/Dialect/OpenACC/ops.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
index a8494cbea200..8038b93930f4 100644
--- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
+++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
@@ -187,16 +187,12 @@ def OpenACC_DataOp : OpenACC_Op<"data",
                        Variadic<AnyType>:$createOperands,
                        Variadic<AnyType>:$createZeroOperands,
                        Variadic<AnyType>:$noCreateOperands,
-                       Variadic<AnyType>:$deleteOperands,
-                       Variadic<AnyType>:$attachOperands,
-                       Variadic<AnyType>:$detachOperands);
+                       Variadic<AnyType>:$attachOperands);
 
   let regions = (region AnyRegion:$region);
 
   let extraClassDeclaration = [{
     static StringRef getAttachKeyword() { return "attach"; }
-    static StringRef getDeleteKeyword() { return "delete"; }
-    static StringRef getDetachKeyword() { return "detach"; }
     static StringRef getCopyinKeyword() { return "copyin"; }
     static StringRef getCopyinReadonlyKeyword() { return "copyin_readonly"; }
     static StringRef getCopyKeyword() { return "copy"; }

diff  --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
index 85524680018f..fc0c9e7f8505 100644
--- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
+++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
@@ -458,21 +458,18 @@ static void print(OpAsmPrinter &printer, ParallelOp &op) {
 ///                         (`create` `(` value-list `)`)?
 ///                         (`create_zero` `(` value-list `)`)?
 ///                         (`no_create` `(` value-list `)`)?
-///                         (`delete` `(` value-list `)`)?
 ///                         (`attach` `(` value-list `)`)?
-///                         (`detach` `(` value-list `)`)?
 ///                         region attr-dict?
 static ParseResult parseDataOp(OpAsmParser &parser, OperationState &result) {
   Builder &builder = parser.getBuilder();
   SmallVector<OpAsmParser::OperandType, 2> presentOperands, copyOperands,
       copyinOperands, copyinReadonlyOperands, copyoutOperands,
       copyoutZeroOperands, createOperands, createZeroOperands, noCreateOperands,
-      deleteOperands, attachOperands, detachOperands;
+      attachOperands;
   SmallVector<Type, 2> presentOperandTypes, copyOperandTypes,
       copyinOperandTypes, copyinReadonlyOperandTypes, copyoutOperandTypes,
       copyoutZeroOperandTypes, createOperandTypes, createZeroOperandTypes,
-      noCreateOperandTypes, deleteOperandTypes, attachOperandTypes,
-      detachOperandTypes;
+      noCreateOperandTypes, attachOperandTypes;
 
   // present(value-list)?
   if (failed(parseOperandList(parser, DataOp::getPresentKeyword(),
@@ -522,21 +519,11 @@ static ParseResult parseDataOp(OpAsmParser &parser, OperationState &result) {
                               noCreateOperands, noCreateOperandTypes, result)))
     return failure();
 
-  // delete(value-list)?
-  if (failed(parseOperandList(parser, DataOp::getDeleteKeyword(),
-                              deleteOperands, deleteOperandTypes, result)))
-    return failure();
-
   // attach(value-list)?
   if (failed(parseOperandList(parser, DataOp::getAttachKeyword(),
                               attachOperands, attachOperandTypes, result)))
     return failure();
 
-  // detach(value-list)?
-  if (failed(parseOperandList(parser, DataOp::getDetachKeyword(),
-                              detachOperands, detachOperandTypes, result)))
-    return failure();
-
   // Data op region
   if (failed(parseRegions<ParallelOp>(parser, result)))
     return failure();
@@ -552,9 +539,7 @@ static ParseResult parseDataOp(OpAsmParser &parser, OperationState &result) {
                            static_cast<int32_t>(createOperands.size()),
                            static_cast<int32_t>(createZeroOperands.size()),
                            static_cast<int32_t>(noCreateOperands.size()),
-                           static_cast<int32_t>(deleteOperands.size()),
-                           static_cast<int32_t>(attachOperands.size()),
-                           static_cast<int32_t>(detachOperands.size())}));
+                           static_cast<int32_t>(attachOperands.size())}));
 
   // Additional attributes
   if (failed(parser.parseOptionalAttrDictWithKeyword(result.attributes)))
@@ -597,15 +582,9 @@ static void print(OpAsmPrinter &printer, DataOp &op) {
   printOperandList(op.noCreateOperands(), DataOp::getNoCreateKeyword(),
                    printer);
 
-  // delete(value-list)?
-  printOperandList(op.deleteOperands(), DataOp::getDeleteKeyword(), printer);
-
   // attach(value-list)?
   printOperandList(op.attachOperands(), DataOp::getAttachKeyword(), printer);
 
-  // detach(value-list)?
-  printOperandList(op.detachOperands(), DataOp::getDetachKeyword(), printer);
-
   printer.printRegion(op.region(),
                       /*printEntryBlockArgs=*/false,
                       /*printBlockTerminators=*/true);

diff  --git a/mlir/test/Dialect/OpenACC/ops.mlir b/mlir/test/Dialect/OpenACC/ops.mlir
index 337160974daf..75b1ac657c88 100644
--- a/mlir/test/Dialect/OpenACC/ops.mlir
+++ b/mlir/test/Dialect/OpenACC/ops.mlir
@@ -472,12 +472,8 @@ func @testdataop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>)
   }
   acc.data no_create(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>) {
   }
-  acc.data delete(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>) {
-  }
   acc.data attach(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>) {
   }
-  acc.data detach(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>) {
-  }
   acc.data present(%a: memref<10xf32>) copyin(%b: memref<10xf32>) copyout(%c: memref<10x10xf32>) {
   }
   return
@@ -502,11 +498,7 @@ func @testdataop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>)
 // CHECK-NEXT: }
 // CHECK:      acc.data no_create([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
 // CHECK-NEXT: }
-// CHECK:      acc.data delete([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
-// CHECK-NEXT: }
 // CHECK:      acc.data attach([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
 // CHECK-NEXT: }
-// CHECK:      acc.data detach([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
-// CHECK-NEXT: }
 // CHECK:      acc.data present([[ARGA]]: memref<10xf32>) copyin([[ARGB]]: memref<10xf32>) copyout([[ARGC]]: memref<10x10xf32>) {
 // CHECK-NEXT: }


        


More information about the Mlir-commits mailing list