forked from OSchip/llvm-project
[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:
parent
155ac33394
commit
3d2bab176f
|
@ -187,16 +187,12 @@ def OpenACC_DataOp : OpenACC_Op<"data",
|
||||||
Variadic<AnyType>:$createOperands,
|
Variadic<AnyType>:$createOperands,
|
||||||
Variadic<AnyType>:$createZeroOperands,
|
Variadic<AnyType>:$createZeroOperands,
|
||||||
Variadic<AnyType>:$noCreateOperands,
|
Variadic<AnyType>:$noCreateOperands,
|
||||||
Variadic<AnyType>:$deleteOperands,
|
Variadic<AnyType>:$attachOperands);
|
||||||
Variadic<AnyType>:$attachOperands,
|
|
||||||
Variadic<AnyType>:$detachOperands);
|
|
||||||
|
|
||||||
let regions = (region AnyRegion:$region);
|
let regions = (region AnyRegion:$region);
|
||||||
|
|
||||||
let extraClassDeclaration = [{
|
let extraClassDeclaration = [{
|
||||||
static StringRef getAttachKeyword() { return "attach"; }
|
static StringRef getAttachKeyword() { return "attach"; }
|
||||||
static StringRef getDeleteKeyword() { return "delete"; }
|
|
||||||
static StringRef getDetachKeyword() { return "detach"; }
|
|
||||||
static StringRef getCopyinKeyword() { return "copyin"; }
|
static StringRef getCopyinKeyword() { return "copyin"; }
|
||||||
static StringRef getCopyinReadonlyKeyword() { return "copyin_readonly"; }
|
static StringRef getCopyinReadonlyKeyword() { return "copyin_readonly"; }
|
||||||
static StringRef getCopyKeyword() { return "copy"; }
|
static StringRef getCopyKeyword() { return "copy"; }
|
||||||
|
|
|
@ -458,21 +458,18 @@ static void print(OpAsmPrinter &printer, ParallelOp &op) {
|
||||||
/// (`create` `(` value-list `)`)?
|
/// (`create` `(` value-list `)`)?
|
||||||
/// (`create_zero` `(` value-list `)`)?
|
/// (`create_zero` `(` value-list `)`)?
|
||||||
/// (`no_create` `(` value-list `)`)?
|
/// (`no_create` `(` value-list `)`)?
|
||||||
/// (`delete` `(` value-list `)`)?
|
|
||||||
/// (`attach` `(` value-list `)`)?
|
/// (`attach` `(` value-list `)`)?
|
||||||
/// (`detach` `(` value-list `)`)?
|
|
||||||
/// region attr-dict?
|
/// region attr-dict?
|
||||||
static ParseResult parseDataOp(OpAsmParser &parser, OperationState &result) {
|
static ParseResult parseDataOp(OpAsmParser &parser, OperationState &result) {
|
||||||
Builder &builder = parser.getBuilder();
|
Builder &builder = parser.getBuilder();
|
||||||
SmallVector<OpAsmParser::OperandType, 2> presentOperands, copyOperands,
|
SmallVector<OpAsmParser::OperandType, 2> presentOperands, copyOperands,
|
||||||
copyinOperands, copyinReadonlyOperands, copyoutOperands,
|
copyinOperands, copyinReadonlyOperands, copyoutOperands,
|
||||||
copyoutZeroOperands, createOperands, createZeroOperands, noCreateOperands,
|
copyoutZeroOperands, createOperands, createZeroOperands, noCreateOperands,
|
||||||
deleteOperands, attachOperands, detachOperands;
|
attachOperands;
|
||||||
SmallVector<Type, 2> presentOperandTypes, copyOperandTypes,
|
SmallVector<Type, 2> presentOperandTypes, copyOperandTypes,
|
||||||
copyinOperandTypes, copyinReadonlyOperandTypes, copyoutOperandTypes,
|
copyinOperandTypes, copyinReadonlyOperandTypes, copyoutOperandTypes,
|
||||||
copyoutZeroOperandTypes, createOperandTypes, createZeroOperandTypes,
|
copyoutZeroOperandTypes, createOperandTypes, createZeroOperandTypes,
|
||||||
noCreateOperandTypes, deleteOperandTypes, attachOperandTypes,
|
noCreateOperandTypes, attachOperandTypes;
|
||||||
detachOperandTypes;
|
|
||||||
|
|
||||||
// present(value-list)?
|
// present(value-list)?
|
||||||
if (failed(parseOperandList(parser, DataOp::getPresentKeyword(),
|
if (failed(parseOperandList(parser, DataOp::getPresentKeyword(),
|
||||||
|
@ -522,21 +519,11 @@ static ParseResult parseDataOp(OpAsmParser &parser, OperationState &result) {
|
||||||
noCreateOperands, noCreateOperandTypes, result)))
|
noCreateOperands, noCreateOperandTypes, result)))
|
||||||
return failure();
|
return failure();
|
||||||
|
|
||||||
// delete(value-list)?
|
|
||||||
if (failed(parseOperandList(parser, DataOp::getDeleteKeyword(),
|
|
||||||
deleteOperands, deleteOperandTypes, result)))
|
|
||||||
return failure();
|
|
||||||
|
|
||||||
// attach(value-list)?
|
// attach(value-list)?
|
||||||
if (failed(parseOperandList(parser, DataOp::getAttachKeyword(),
|
if (failed(parseOperandList(parser, DataOp::getAttachKeyword(),
|
||||||
attachOperands, attachOperandTypes, result)))
|
attachOperands, attachOperandTypes, result)))
|
||||||
return failure();
|
return failure();
|
||||||
|
|
||||||
// detach(value-list)?
|
|
||||||
if (failed(parseOperandList(parser, DataOp::getDetachKeyword(),
|
|
||||||
detachOperands, detachOperandTypes, result)))
|
|
||||||
return failure();
|
|
||||||
|
|
||||||
// Data op region
|
// Data op region
|
||||||
if (failed(parseRegions<ParallelOp>(parser, result)))
|
if (failed(parseRegions<ParallelOp>(parser, result)))
|
||||||
return failure();
|
return failure();
|
||||||
|
@ -552,9 +539,7 @@ static ParseResult parseDataOp(OpAsmParser &parser, OperationState &result) {
|
||||||
static_cast<int32_t>(createOperands.size()),
|
static_cast<int32_t>(createOperands.size()),
|
||||||
static_cast<int32_t>(createZeroOperands.size()),
|
static_cast<int32_t>(createZeroOperands.size()),
|
||||||
static_cast<int32_t>(noCreateOperands.size()),
|
static_cast<int32_t>(noCreateOperands.size()),
|
||||||
static_cast<int32_t>(deleteOperands.size()),
|
static_cast<int32_t>(attachOperands.size())}));
|
||||||
static_cast<int32_t>(attachOperands.size()),
|
|
||||||
static_cast<int32_t>(detachOperands.size())}));
|
|
||||||
|
|
||||||
// Additional attributes
|
// Additional attributes
|
||||||
if (failed(parser.parseOptionalAttrDictWithKeyword(result.attributes)))
|
if (failed(parser.parseOptionalAttrDictWithKeyword(result.attributes)))
|
||||||
|
@ -597,15 +582,9 @@ static void print(OpAsmPrinter &printer, DataOp &op) {
|
||||||
printOperandList(op.noCreateOperands(), DataOp::getNoCreateKeyword(),
|
printOperandList(op.noCreateOperands(), DataOp::getNoCreateKeyword(),
|
||||||
printer);
|
printer);
|
||||||
|
|
||||||
// delete(value-list)?
|
|
||||||
printOperandList(op.deleteOperands(), DataOp::getDeleteKeyword(), printer);
|
|
||||||
|
|
||||||
// attach(value-list)?
|
// attach(value-list)?
|
||||||
printOperandList(op.attachOperands(), DataOp::getAttachKeyword(), printer);
|
printOperandList(op.attachOperands(), DataOp::getAttachKeyword(), printer);
|
||||||
|
|
||||||
// detach(value-list)?
|
|
||||||
printOperandList(op.detachOperands(), DataOp::getDetachKeyword(), printer);
|
|
||||||
|
|
||||||
printer.printRegion(op.region(),
|
printer.printRegion(op.region(),
|
||||||
/*printEntryBlockArgs=*/false,
|
/*printEntryBlockArgs=*/false,
|
||||||
/*printBlockTerminators=*/true);
|
/*printBlockTerminators=*/true);
|
||||||
|
|
|
@ -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 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 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>) {
|
acc.data present(%a: memref<10xf32>) copyin(%b: memref<10xf32>) copyout(%c: memref<10x10xf32>) {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -502,11 +498,7 @@ func @testdataop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10xf32>)
|
||||||
// CHECK-NEXT: }
|
// CHECK-NEXT: }
|
||||||
// CHECK: acc.data no_create([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
|
// CHECK: acc.data no_create([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
|
||||||
// CHECK-NEXT: }
|
// 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: acc.data attach([[ARGA]]: memref<10xf32>, [[ARGB]]: memref<10xf32>, [[ARGC]]: memref<10x10xf32>) {
|
||||||
// CHECK-NEXT: }
|
// 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: acc.data present([[ARGA]]: memref<10xf32>) copyin([[ARGB]]: memref<10xf32>) copyout([[ARGC]]: memref<10x10xf32>) {
|
||||||
// CHECK-NEXT: }
|
// CHECK-NEXT: }
|
||||||
|
|
Loading…
Reference in New Issue