Skip to content

Commit 3d2bab1

Browse files
committed
[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
1 parent 155ac33 commit 3d2bab1

File tree

3 files changed

+4
-37
lines changed

3 files changed

+4
-37
lines changed

mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,12 @@ def OpenACC_DataOp : OpenACC_Op<"data",
187187
Variadic<AnyType>:$createOperands,
188188
Variadic<AnyType>:$createZeroOperands,
189189
Variadic<AnyType>:$noCreateOperands,
190-
Variadic<AnyType>:$deleteOperands,
191-
Variadic<AnyType>:$attachOperands,
192-
Variadic<AnyType>:$detachOperands);
190+
Variadic<AnyType>:$attachOperands);
193191

194192
let regions = (region AnyRegion:$region);
195193

196194
let extraClassDeclaration = [{
197195
static StringRef getAttachKeyword() { return "attach"; }
198-
static StringRef getDeleteKeyword() { return "delete"; }
199-
static StringRef getDetachKeyword() { return "detach"; }
200196
static StringRef getCopyinKeyword() { return "copyin"; }
201197
static StringRef getCopyinReadonlyKeyword() { return "copyin_readonly"; }
202198
static StringRef getCopyKeyword() { return "copy"; }

mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -458,21 +458,18 @@ static void print(OpAsmPrinter &printer, ParallelOp &op) {
458458
/// (`create` `(` value-list `)`)?
459459
/// (`create_zero` `(` value-list `)`)?
460460
/// (`no_create` `(` value-list `)`)?
461-
/// (`delete` `(` value-list `)`)?
462461
/// (`attach` `(` value-list `)`)?
463-
/// (`detach` `(` value-list `)`)?
464462
/// region attr-dict?
465463
static ParseResult parseDataOp(OpAsmParser &parser, OperationState &result) {
466464
Builder &builder = parser.getBuilder();
467465
SmallVector<OpAsmParser::OperandType, 2> presentOperands, copyOperands,
468466
copyinOperands, copyinReadonlyOperands, copyoutOperands,
469467
copyoutZeroOperands, createOperands, createZeroOperands, noCreateOperands,
470-
deleteOperands, attachOperands, detachOperands;
468+
attachOperands;
471469
SmallVector<Type, 2> presentOperandTypes, copyOperandTypes,
472470
copyinOperandTypes, copyinReadonlyOperandTypes, copyoutOperandTypes,
473471
copyoutZeroOperandTypes, createOperandTypes, createZeroOperandTypes,
474-
noCreateOperandTypes, deleteOperandTypes, attachOperandTypes,
475-
detachOperandTypes;
472+
noCreateOperandTypes, attachOperandTypes;
476473

477474
// present(value-list)?
478475
if (failed(parseOperandList(parser, DataOp::getPresentKeyword(),
@@ -522,21 +519,11 @@ static ParseResult parseDataOp(OpAsmParser &parser, OperationState &result) {
522519
noCreateOperands, noCreateOperandTypes, result)))
523520
return failure();
524521

525-
// delete(value-list)?
526-
if (failed(parseOperandList(parser, DataOp::getDeleteKeyword(),
527-
deleteOperands, deleteOperandTypes, result)))
528-
return failure();
529-
530522
// attach(value-list)?
531523
if (failed(parseOperandList(parser, DataOp::getAttachKeyword(),
532524
attachOperands, attachOperandTypes, result)))
533525
return failure();
534526

535-
// detach(value-list)?
536-
if (failed(parseOperandList(parser, DataOp::getDetachKeyword(),
537-
detachOperands, detachOperandTypes, result)))
538-
return failure();
539-
540527
// Data op region
541528
if (failed(parseRegions<ParallelOp>(parser, result)))
542529
return failure();
@@ -552,9 +539,7 @@ static ParseResult parseDataOp(OpAsmParser &parser, OperationState &result) {
552539
static_cast<int32_t>(createOperands.size()),
553540
static_cast<int32_t>(createZeroOperands.size()),
554541
static_cast<int32_t>(noCreateOperands.size()),
555-
static_cast<int32_t>(deleteOperands.size()),
556-
static_cast<int32_t>(attachOperands.size()),
557-
static_cast<int32_t>(detachOperands.size())}));
542+
static_cast<int32_t>(attachOperands.size())}));
558543

559544
// Additional attributes
560545
if (failed(parser.parseOptionalAttrDictWithKeyword(result.attributes)))
@@ -597,15 +582,9 @@ static void print(OpAsmPrinter &printer, DataOp &op) {
597582
printOperandList(op.noCreateOperands(), DataOp::getNoCreateKeyword(),
598583
printer);
599584

600-
// delete(value-list)?
601-
printOperandList(op.deleteOperands(), DataOp::getDeleteKeyword(), printer);
602-
603585
// attach(value-list)?
604586
printOperandList(op.attachOperands(), DataOp::getAttachKeyword(), printer);
605587

606-
// detach(value-list)?
607-
printOperandList(op.detachOperands(), DataOp::getDetachKeyword(), printer);
608-
609588
printer.printRegion(op.region(),
610589
/*printEntryBlockArgs=*/false,
611590
/*printBlockTerminators=*/true);

mlir/test/Dialect/OpenACC/ops.mlir

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,8 @@ func @testdataop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>)
472472
}
473473
acc.data no_create(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>) {
474474
}
475-
acc.data delete(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>) {
476-
}
477475
acc.data attach(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>) {
478476
}
479-
acc.data detach(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>) {
480-
}
481477
acc.data present(%a: memref<10xf32>) copyin(%b: memref<10xf32>) copyout(%c: memref<10x10xf32>) {
482478
}
483479
return
@@ -502,11 +498,7 @@ func @testdataop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>)
502498
// CHECK-NEXT: }
503499
// CHECK: acc.data no_create([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
504500
// CHECK-NEXT: }
505-
// CHECK: acc.data delete([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
506-
// CHECK-NEXT: }
507501
// CHECK: acc.data attach([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
508502
// CHECK-NEXT: }
509-
// CHECK: acc.data detach([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
510-
// CHECK-NEXT: }
511503
// CHECK: acc.data present([[ARGA]]: memref<10xf32>) copyin([[ARGB]]: memref<10xf32>) copyout([[ARGC]]: memref<10x10xf32>) {
512504
// CHECK-NEXT: }

0 commit comments

Comments
 (0)