[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
This commit is contained in:
Valentin Clement 2020-09-27 20:27:54 -04:00 committed by clementval
parent 155ac33394
commit 3d2bab176f
3 changed files with 4 additions and 37 deletions

View File

@ -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"; }

View File

@ -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);

View File

@ -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: }