diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td --- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td @@ -110,8 +110,12 @@ OpenACC_Reduction, OpenACC_DeclareDeviceResident, OpenACC_DeclareLink, ]> { let cppNamespace = "::mlir::acc"; + let genSpecializedAttr = 0; } +def OpenACC_DataClauseAttr : EnumAttr; + // Used for data specification in data clauses (2.7.1). // Either (or both) extent and upperbound must be specified. def OpenACC_DataBoundsOp : OpenACC_Op<"bounds", @@ -190,7 +194,7 @@ let arguments = (ins OpenACC_PointerLikeTypeInterface:$varPtr, Optional:$varPtrPtr, Variadic:$bounds, /* rank-0 to rank-{n-1} */ - DefaultValuedAttr:$dataClause, + DefaultValuedAttr:$dataClause, DefaultValuedAttr:$structured, DefaultValuedAttr:$implicit, OptionalAttr:$name); @@ -377,7 +381,7 @@ let arguments = (ins OpenACC_PointerLikeTypeInterface:$accPtr, Optional:$varPtr, Variadic:$bounds, - DefaultValuedAttr:$dataClause, + DefaultValuedAttr:$dataClause, DefaultValuedAttr:$structured, DefaultValuedAttr:$implicit, OptionalAttr:$name); diff --git a/mlir/test/Dialect/OpenACC/ops.mlir b/mlir/test/Dialect/OpenACC/ops.mlir --- a/mlir/test/Dialect/OpenACC/ops.mlir +++ b/mlir/test/Dialect/OpenACC/ops.mlir @@ -736,47 +736,47 @@ acc.data dataOperands(%5, %6, %7 : memref, memref, memref) { } - %8 = acc.copyin varPtr(%a : memref) -> memref {dataClause = 2 : i64} - %9 = acc.copyin varPtr(%b : memref) -> memref {dataClause = 2 : i64} - %10 = acc.copyin varPtr(%c : memref) -> memref {dataClause = 2 : i64} + %8 = acc.copyin varPtr(%a : memref) -> memref {dataClause = #acc} + %9 = acc.copyin varPtr(%b : memref) -> memref {dataClause = #acc} + %10 = acc.copyin varPtr(%c : memref) -> memref {dataClause = #acc} acc.data dataOperands(%8, %9, %10 : memref, memref, memref) { } - %11 = acc.create varPtr(%a : memref) -> memref {dataClause = 4 : i64} - %12 = acc.create varPtr(%b : memref) -> memref {dataClause = 4 : i64} - %13 = acc.create varPtr(%c : memref) -> memref {dataClause = 4 : i64} + %11 = acc.create varPtr(%a : memref) -> memref {dataClause = #acc} + %12 = acc.create varPtr(%b : memref) -> memref {dataClause = #acc} + %13 = acc.create varPtr(%c : memref) -> memref {dataClause = #acc} acc.data dataOperands(%11, %12, %13 : memref, memref, memref) { } acc.copyout accPtr(%11 : memref) to varPtr(%a : memref) acc.copyout accPtr(%12 : memref) to varPtr(%b : memref) acc.copyout accPtr(%13 : memref) to varPtr(%c : memref) - %14 = acc.create varPtr(%a : memref) -> memref {dataClause = 5 : i64} - %15 = acc.create varPtr(%b : memref) -> memref {dataClause = 5 : i64} - %16 = acc.create varPtr(%c : memref) -> memref {dataClause = 5 : i64} + %14 = acc.create varPtr(%a : memref) -> memref {dataClause = #acc} + %15 = acc.create varPtr(%b : memref) -> memref {dataClause = #acc} + %16 = acc.create varPtr(%c : memref) -> memref {dataClause = #acc} acc.data dataOperands(%14, %15, %16 : memref, memref, memref) { } - acc.copyout accPtr(%14 : memref) to varPtr(%a : memref) {dataClause = 5 : i64} - acc.copyout accPtr(%15 : memref) to varPtr(%b : memref) {dataClause = 5 : i64} - acc.copyout accPtr(%16 : memref) to varPtr(%c : memref) {dataClause = 5 : i64} + acc.copyout accPtr(%14 : memref) to varPtr(%a : memref) {dataClause = #acc} + acc.copyout accPtr(%15 : memref) to varPtr(%b : memref) {dataClause = #acc} + acc.copyout accPtr(%16 : memref) to varPtr(%c : memref) {dataClause = #acc} %17 = acc.create varPtr(%a : memref) -> memref %18 = acc.create varPtr(%b : memref) -> memref %19 = acc.create varPtr(%c : memref) -> memref acc.data dataOperands(%17, %18, %19 : memref, memref, memref) { } - acc.delete accPtr(%17 : memref) {dataClause = 7 : i64} - acc.delete accPtr(%18 : memref) {dataClause = 7 : i64} - acc.delete accPtr(%19 : memref) {dataClause = 7 : i64} + acc.delete accPtr(%17 : memref) {dataClause = #acc} + acc.delete accPtr(%18 : memref) {dataClause = #acc} + acc.delete accPtr(%19 : memref) {dataClause = #acc} - %20 = acc.create varPtr(%a : memref) -> memref {dataClause = 8 : i64} - %21 = acc.create varPtr(%b : memref) -> memref {dataClause = 8 : i64} - %22 = acc.create varPtr(%c : memref) -> memref {dataClause = 8 : i64} + %20 = acc.create varPtr(%a : memref) -> memref {dataClause = #acc} + %21 = acc.create varPtr(%b : memref) -> memref {dataClause = #acc} + %22 = acc.create varPtr(%c : memref) -> memref {dataClause = #acc} acc.data dataOperands(%20, %21, %22 : memref, memref, memref) { } - acc.delete accPtr(%20 : memref) {dataClause = 8 : i64} - acc.delete accPtr(%21 : memref) {dataClause = 8 : i64} - acc.delete accPtr(%22 : memref) {dataClause = 8 : i64} + acc.delete accPtr(%20 : memref) {dataClause = #acc} + acc.delete accPtr(%21 : memref) {dataClause = #acc} + acc.delete accPtr(%22 : memref) {dataClause = #acc} %23 = acc.nocreate varPtr(%a : memref) -> memref %24 = acc.nocreate varPtr(%b : memref) -> memref @@ -797,7 +797,7 @@ } %32 = acc.copyin varPtr(%a : memref) -> memref - %33 = acc.create varPtr(%b : memref) -> memref {dataClause = 4 : i64} + %33 = acc.create varPtr(%b : memref) -> memref {dataClause = #acc} %34 = acc.present varPtr(%c : memref) -> memref acc.data dataOperands(%32, %33, %34 : memref, memref, memref) { } @@ -859,29 +859,29 @@ // CHECK: acc.data dataOperands(%[[COPYIN_A]], %[[COPYIN_B]], %[[COPYIN_C]] : memref, memref, memref) { // CHECK-NEXT: } -// CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[ARGA]] : memref) -> memref {dataClause = 2 : i64} -// CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[ARGB]] : memref) -> memref {dataClause = 2 : i64} -// CHECK: %[[COPYIN_C:.*]] = acc.copyin varPtr(%[[ARGC]] : memref) -> memref {dataClause = 2 : i64} +// CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[ARGA]] : memref) -> memref {dataClause = #acc} +// CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[ARGB]] : memref) -> memref {dataClause = #acc} +// CHECK: %[[COPYIN_C:.*]] = acc.copyin varPtr(%[[ARGC]] : memref) -> memref {dataClause = #acc} // CHECK: acc.data dataOperands(%[[COPYIN_A]], %[[COPYIN_B]], %[[COPYIN_C]] : memref, memref, memref) { // CHECK-NEXT: } -// CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[ARGA]] : memref) -> memref {dataClause = 4 : i64} -// CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref {dataClause = 4 : i64} -// CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[ARGC]] : memref) -> memref {dataClause = 4 : i64} +// CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[ARGA]] : memref) -> memref {dataClause = #acc} +// CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref {dataClause = #acc} +// CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[ARGC]] : memref) -> memref {dataClause = #acc} // CHECK: acc.data dataOperands(%[[CREATE_A]], %[[CREATE_B]], %[[CREATE_C]] : memref, memref, memref) { // CHECK-NEXT: } // CHECK: acc.copyout accPtr(%[[CREATE_A]] : memref) to varPtr(%[[ARGA]] : memref) // CHECK: acc.copyout accPtr(%[[CREATE_B]] : memref) to varPtr(%[[ARGB]] : memref) // CHECK: acc.copyout accPtr(%[[CREATE_C]] : memref) to varPtr(%[[ARGC]] : memref) -// CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[ARGA]] : memref) -> memref {dataClause = 5 : i64} -// CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref {dataClause = 5 : i64} -// CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[ARGC]] : memref) -> memref {dataClause = 5 : i64} +// CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[ARGA]] : memref) -> memref {dataClause = #acc} +// CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref {dataClause = #acc} +// CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[ARGC]] : memref) -> memref {dataClause = #acc} // CHECK: acc.data dataOperands(%[[CREATE_A]], %[[CREATE_B]], %[[CREATE_C]] : memref, memref, memref) { // CHECK-NEXT: } -// CHECK: acc.copyout accPtr(%[[CREATE_A]] : memref) to varPtr(%[[ARGA]] : memref) {dataClause = 5 : i64} -// CHECK: acc.copyout accPtr(%[[CREATE_B]] : memref) to varPtr(%[[ARGB]] : memref) {dataClause = 5 : i64} -// CHECK: acc.copyout accPtr(%[[CREATE_C]] : memref) to varPtr(%[[ARGC]] : memref) {dataClause = 5 : i64} +// CHECK: acc.copyout accPtr(%[[CREATE_A]] : memref) to varPtr(%[[ARGA]] : memref) {dataClause = #acc} +// CHECK: acc.copyout accPtr(%[[CREATE_B]] : memref) to varPtr(%[[ARGB]] : memref) {dataClause = #acc} +// CHECK: acc.copyout accPtr(%[[CREATE_C]] : memref) to varPtr(%[[ARGC]] : memref) {dataClause = #acc} // CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[ARGA]] : memref) -> memref // CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref @@ -889,9 +889,9 @@ // CHECK: acc.data dataOperands(%[[CREATE_A]], %[[CREATE_B]], %[[CREATE_C]] : memref, memref, memref) { // CHECK-NEXT: } -// CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[ARGA]] : memref) -> memref {dataClause = 8 : i64} -// CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref {dataClause = 8 : i64} -// CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[ARGC]] : memref) -> memref {dataClause = 8 : i64} +// CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[ARGA]] : memref) -> memref {dataClause = #acc} +// CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref {dataClause = #acc} +// CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[ARGC]] : memref) -> memref {dataClause = #acc} // CHECK: acc.data dataOperands(%[[CREATE_A]], %[[CREATE_B]], %[[CREATE_C]] : memref, memref, memref) { // CHECK-NEXT: } @@ -915,7 +915,7 @@ // CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[ARGA]] : memref) -> memref -// CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref {dataClause = 4 : i64} +// CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref {dataClause = #acc} // CHECK: %[[PRESENT_C:.*]] = acc.present varPtr(%[[ARGC]] : memref) -> memref // CHECK: acc.data dataOperands(%[[COPYIN_A]], %[[CREATE_B]], %[[PRESENT_C]] : memref, memref, memref) { // CHECK-NEXT: } @@ -1202,8 +1202,8 @@ %0 = acc.copyin varPtr(%a : !llvm.ptr) -> !llvm.ptr acc.enter_data dataOperands(%0 : !llvm.ptr) %1 = acc.create varPtr(%a : !llvm.ptr) -> !llvm.ptr - %2 = acc.create varPtr(%b : !llvm.ptr) -> !llvm.ptr {dataClause = 8 : i64} - %3 = acc.create varPtr(%c : !llvm.ptr) -> !llvm.ptr {dataClause = 8 : i64} + %2 = acc.create varPtr(%b : !llvm.ptr) -> !llvm.ptr {dataClause = #acc} + %3 = acc.create varPtr(%c : !llvm.ptr) -> !llvm.ptr {dataClause = #acc} acc.enter_data dataOperands(%1, %2, %3 : !llvm.ptr, !llvm.ptr, !llvm.ptr) %4 = acc.attach varPtr(%a : !llvm.ptr) -> !llvm.ptr acc.enter_data dataOperands(%4 : !llvm.ptr) @@ -1231,8 +1231,8 @@ // CHECK: %[[COPYIN:.*]] = acc.copyin varPtr(%[[ARGA]] : !llvm.ptr) -> !llvm.ptr // CHECK: acc.enter_data dataOperands(%[[COPYIN]] : !llvm.ptr) // CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[ARGA]] : !llvm.ptr) -> !llvm.ptr -// CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : !llvm.ptr) -> !llvm.ptr {dataClause = 8 : i64} -// CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[ARGC]] : !llvm.ptr) -> !llvm.ptr {dataClause = 8 : i64} +// CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[ARGB]] : !llvm.ptr) -> !llvm.ptr {dataClause = #acc} +// CHECK: %[[CREATE_C:.*]] = acc.create varPtr(%[[ARGC]] : !llvm.ptr) -> !llvm.ptr {dataClause = #acc} // CHECK: acc.enter_data dataOperands(%[[CREATE_A]], %[[CREATE_B]], %[[CREATE_C]] : !llvm.ptr, !llvm.ptr, !llvm.ptr) // CHECK: %[[ATTACH:.*]] = acc.attach varPtr(%[[ARGA]] : !llvm.ptr) -> !llvm.ptr // CHECK: acc.enter_data dataOperands(%[[ATTACH]] : !llvm.ptr) @@ -1264,36 +1264,36 @@ acc.parallel dataOperands(%copyin : memref<10xf32>) { } - %copyinreadonly = acc.copyin varPtr(%a : memref<10xf32>) -> memref<10xf32> {dataClause = 2} + %copyinreadonly = acc.copyin varPtr(%a : memref<10xf32>) -> memref<10xf32> {dataClause = #acc} acc.kernels dataOperands(%copyinreadonly : memref<10xf32>) { } - %copyinfromcopy = acc.copyin varPtr(%a : memref<10xf32>) -> memref<10xf32> {dataClause = 3} + %copyinfromcopy = acc.copyin varPtr(%a : memref<10xf32>) -> memref<10xf32> {dataClause = #acc} acc.serial dataOperands(%copyinfromcopy : memref<10xf32>) { } - acc.copyout accPtr(%copyinfromcopy : memref<10xf32>) to varPtr(%a : memref<10xf32>) {dataClause = 3} + acc.copyout accPtr(%copyinfromcopy : memref<10xf32>) to varPtr(%a : memref<10xf32>) {dataClause = #acc} %create = acc.create varPtr(%a : memref<10xf32>) -> memref<10xf32> %createimplicit = acc.create varPtr(%c : memref<10x20xf32>) -> memref<10x20xf32> {implicit = true} acc.parallel dataOperands(%create, %createimplicit : memref<10xf32>, memref<10x20xf32>) { } - acc.delete accPtr(%create : memref<10xf32>) {dataClause = 7} - acc.delete accPtr(%createimplicit : memref<10x20xf32>) {dataClause = 7, implicit = true} + acc.delete accPtr(%create : memref<10xf32>) {dataClause = #acc} + acc.delete accPtr(%createimplicit : memref<10x20xf32>) {dataClause = #acc, implicit = true} - %copyoutzero = acc.create varPtr(%a : memref<10xf32>) -> memref<10xf32> {dataClause = 5} + %copyoutzero = acc.create varPtr(%a : memref<10xf32>) -> memref<10xf32> {dataClause = #acc} acc.parallel dataOperands(%copyoutzero: memref<10xf32>) { } - acc.copyout accPtr(%copyoutzero : memref<10xf32>) to varPtr(%a : memref<10xf32>) {dataClause = 5} + acc.copyout accPtr(%copyoutzero : memref<10xf32>) to varPtr(%a : memref<10xf32>) {dataClause = #acc} %attach = acc.attach varPtr(%b : memref>) -> memref> acc.parallel dataOperands(%attach : memref>) { } - acc.detach accPtr(%attach : memref>) {dataClause = 10} + acc.detach accPtr(%attach : memref>) {dataClause = #acc} - %copyinparent = acc.copyin varPtr(%a : memref<10xf32>) varPtrPtr(%b : memref>) -> memref<10xf32> {dataClause = 3} + %copyinparent = acc.copyin varPtr(%a : memref<10xf32>) varPtrPtr(%b : memref>) -> memref<10xf32> {dataClause = #acc} acc.parallel dataOperands(%copyinparent : memref<10xf32>) { } - acc.copyout accPtr(%copyinparent : memref<10xf32>) to varPtr(%a : memref<10xf32>) {dataClause = 3} + acc.copyout accPtr(%copyinparent : memref<10xf32>) to varPtr(%a : memref<10xf32>) {dataClause = #acc} %c0 = arith.constant 0 : index %c1 = arith.constant 1 : index @@ -1311,10 +1311,10 @@ } %bounds1partial = acc.bounds lowerbound(%c4 : index) upperbound(%c9 : index) stride(%c1 : index) - %copyinpartial = acc.copyin varPtr(%a : memref<10xf32>) bounds(%bounds1partial) -> memref<10xf32> {dataClause = 3} + %copyinpartial = acc.copyin varPtr(%a : memref<10xf32>) bounds(%bounds1partial) -> memref<10xf32> {dataClause = #acc} acc.parallel dataOperands(%copyinpartial : memref<10xf32>) { } - acc.copyout accPtr(%copyinpartial : memref<10xf32>) bounds(%bounds1partial) to varPtr(%a : memref<10xf32>) {dataClause = 3} + acc.copyout accPtr(%copyinpartial : memref<10xf32>) bounds(%bounds1partial) to varPtr(%a : memref<10xf32>) {dataClause = #acc} return } @@ -1329,31 +1329,31 @@ // CHECK: [[COPYIN:%.*]] = acc.copyin varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> // CHECK-NEXT: acc.parallel dataOperands([[COPYIN]] : memref<10xf32>) { // CHECK-NEXT: } -// CHECK: [[COPYINRO:%.*]] = acc.copyin varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> {dataClause = 2 : i64} +// CHECK: [[COPYINRO:%.*]] = acc.copyin varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> {dataClause = #acc} // CHECK-NEXT: acc.kernels dataOperands([[COPYINRO]] : memref<10xf32>) { // CHECK-NEXT: } -// CHECK: [[COPYINCOPY:%.*]] = acc.copyin varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> {dataClause = 3 : i64} +// CHECK: [[COPYINCOPY:%.*]] = acc.copyin varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> {dataClause = #acc} // CHECK-NEXT: acc.serial dataOperands([[COPYINCOPY]] : memref<10xf32>) { // CHECK-NEXT: } -// CHECK-NEXT: acc.copyout accPtr([[COPYINCOPY]] : memref<10xf32>) to varPtr([[ARGA]] : memref<10xf32>) {dataClause = 3 : i64} +// CHECK-NEXT: acc.copyout accPtr([[COPYINCOPY]] : memref<10xf32>) to varPtr([[ARGA]] : memref<10xf32>) {dataClause = #acc} // CHECK: [[CREATE:%.*]] = acc.create varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> // CHECK-NEXT: [[CREATEIMP:%.*]] = acc.create varPtr([[ARGC]] : memref<10x20xf32>) -> memref<10x20xf32> {implicit = true} // CHECK-NEXT: acc.parallel dataOperands([[CREATE]], [[CREATEIMP]] : memref<10xf32>, memref<10x20xf32>) { // CHECK-NEXT: } -// CHECK-NEXT: acc.delete accPtr([[CREATE]] : memref<10xf32>) {dataClause = 7 : i64} -// CHECK-NEXT: acc.delete accPtr([[CREATEIMP]] : memref<10x20xf32>) {dataClause = 7 : i64, implicit = true} -// CHECK: [[COPYOUTZ:%.*]] = acc.create varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> {dataClause = 5 : i64} +// CHECK-NEXT: acc.delete accPtr([[CREATE]] : memref<10xf32>) {dataClause = #acc} +// CHECK-NEXT: acc.delete accPtr([[CREATEIMP]] : memref<10x20xf32>) {dataClause = #acc, implicit = true} +// CHECK: [[COPYOUTZ:%.*]] = acc.create varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> {dataClause = #acc} // CHECK-NEXT: acc.parallel dataOperands([[COPYOUTZ]] : memref<10xf32>) { // CHECK-NEXT: } -// CHECK-NEXT: acc.copyout accPtr([[COPYOUTZ]] : memref<10xf32>) to varPtr([[ARGA]] : memref<10xf32>) {dataClause = 5 : i64} +// CHECK-NEXT: acc.copyout accPtr([[COPYOUTZ]] : memref<10xf32>) to varPtr([[ARGA]] : memref<10xf32>) {dataClause = #acc} // CHECK: [[ATTACH:%.*]] = acc.attach varPtr([[ARGB]] : memref>) -> memref> // CHECK-NEXT: acc.parallel dataOperands([[ATTACH]] : memref>) { // CHECK-NEXT: } -// CHECK-NEXT: acc.detach accPtr([[ATTACH]] : memref>) {dataClause = 10 : i64} -// CHECK: [[COPYINP:%.*]] = acc.copyin varPtr([[ARGA]] : memref<10xf32>) varPtrPtr([[ARGB]] : memref>) -> memref<10xf32> {dataClause = 3 : i64} +// CHECK-NEXT: acc.detach accPtr([[ATTACH]] : memref>) {dataClause = #acc} +// CHECK: [[COPYINP:%.*]] = acc.copyin varPtr([[ARGA]] : memref<10xf32>) varPtrPtr([[ARGB]] : memref>) -> memref<10xf32> {dataClause = #acc} // CHECK-NEXT: acc.parallel dataOperands([[COPYINP]] : memref<10xf32>) { // CHECK-NEXT: } -// CHECK-NEXT: acc.copyout accPtr([[COPYINP]] : memref<10xf32>) to varPtr([[ARGA]] : memref<10xf32>) {dataClause = 3 : i64} +// CHECK-NEXT: acc.copyout accPtr([[COPYINP]] : memref<10xf32>) to varPtr([[ARGA]] : memref<10xf32>) {dataClause = #acc} // CHECK-DAG: [[CON0:%.*]] = arith.constant 0 : index // CHECK-DAG: [[CON1:%.*]] = arith.constant 1 : index // CHECK-DAG: [[CON4:%.*]] = arith.constant 4 : index @@ -1366,10 +1366,10 @@ // CHECK-NEXT: acc.parallel dataOperands([[COPYINF1]], [[COPYINF2]] : memref<10xf32>, memref<10x20xf32>) { // CHECK-NEXT: } // CHECK: [[BOUNDS1P:%.*]] = acc.bounds lowerbound([[CON4]] : index) upperbound([[CON9]] : index) stride([[CON1]] : index) -// CHECK-NEXT: [[COPYINPART:%.*]] = acc.copyin varPtr([[ARGA]] : memref<10xf32>) bounds([[BOUNDS1P]]) -> memref<10xf32> {dataClause = 3 : i64} +// CHECK-NEXT: [[COPYINPART:%.*]] = acc.copyin varPtr([[ARGA]] : memref<10xf32>) bounds([[BOUNDS1P]]) -> memref<10xf32> {dataClause = #acc} // CHECK-NEXT: acc.parallel dataOperands([[COPYINPART]] : memref<10xf32>) { // CHECK-NEXT: } -// CHECK-NEXT: acc.copyout accPtr([[COPYINPART]] : memref<10xf32>) bounds([[BOUNDS1P]]) to varPtr([[ARGA]] : memref<10xf32>) {dataClause = 3 : i64} +// CHECK-NEXT: acc.copyout accPtr([[COPYINPART]] : memref<10xf32>) bounds([[BOUNDS1P]]) to varPtr([[ARGA]] : memref<10xf32>) {dataClause = #acc} // ----- @@ -1377,7 +1377,7 @@ %copyin = acc.copyin varPtr(%a : memref<10xf32>) -> memref<10xf32> {structured = false} acc.enter_data dataOperands(%copyin : memref<10xf32>) - %devptr = acc.getdeviceptr varPtr(%a : memref<10xf32>) -> memref<10xf32> {dataClause = 4} + %devptr = acc.getdeviceptr varPtr(%a : memref<10xf32>) -> memref<10xf32> {dataClause = #acc} acc.exit_data dataOperands(%devptr : memref<10xf32>) acc.copyout accPtr(%devptr : memref<10xf32>) to varPtr(%a : memref<10xf32>) {structured = false} @@ -1387,14 +1387,14 @@ // CHECK: func.func @testunstructuredclauseops([[ARGA:%.*]]: memref<10xf32>) { // CHECK: [[COPYIN:%.*]] = acc.copyin varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> {structured = false} // CHECK-NEXT: acc.enter_data dataOperands([[COPYIN]] : memref<10xf32>) -// CHECK: [[DEVPTR:%.*]] = acc.getdeviceptr varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> {dataClause = 4 : i64} +// CHECK: [[DEVPTR:%.*]] = acc.getdeviceptr varPtr([[ARGA]] : memref<10xf32>) -> memref<10xf32> {dataClause = #acc} // CHECK-NEXT: acc.exit_data dataOperands([[DEVPTR]] : memref<10xf32>) // CHECK-NEXT: acc.copyout accPtr([[DEVPTR]] : memref<10xf32>) to varPtr([[ARGA]] : memref<10xf32>) {structured = false} // ----- func.func @host_device_ops(%a: memref) -> () { - %devptr = acc.getdeviceptr varPtr(%a : memref) -> memref {dataClause = 16} + %devptr = acc.getdeviceptr varPtr(%a : memref) -> memref acc.update_host accPtr(%devptr : memref) to varPtr(%a : memref) {structured = false} acc.update dataOperands(%devptr : memref) @@ -1544,14 +1544,14 @@ func.func @testdeclareop(%a: memref, %b: memref, %c: memref) -> () { %0 = acc.copyin varPtr(%a : memref) -> memref // copyin(zero) - %1 = acc.copyin varPtr(%b : memref) -> memref {dataClause = 2} + %1 = acc.copyin varPtr(%b : memref) -> memref {dataClause = #acc} // copy - %2 = acc.copyin varPtr(%c : memref) -> memref {dataClause = 3} + %2 = acc.copyin varPtr(%c : memref) -> memref {dataClause = #acc} acc.declare_enter dataOperands(%0, %1, %2 : memref, memref, memref) %3 = acc.create varPtr(%a : memref) -> memref // copyout - %4 = acc.create varPtr(%b : memref) -> memref {dataClause = 4} + %4 = acc.create varPtr(%b : memref) -> memref {dataClause = #acc} %5 = acc.present varPtr(%c : memref) -> memref acc.declare_enter dataOperands(%3, %4, %5 : memref, memref, memref) @@ -1561,18 +1561,18 @@ acc.declare_enter dataOperands(%6, %7, %8 : memref, memref, memref) acc.declare_exit dataOperands(%7, %8 : memref, memref) - acc.delete accPtr(%7 : memref) {dataClause = 22 } - acc.delete accPtr(%8 : memref) {dataClause = 23 } + acc.delete accPtr(%7 : memref) {dataClause = #acc } + acc.delete accPtr(%8 : memref) {dataClause = #acc } acc.declare_exit dataOperands(%3, %4, %5 : memref, memref, memref) - acc.delete accPtr(%3 : memref) {dataClause = 7 } + acc.delete accPtr(%3 : memref) {dataClause = #acc } acc.copyout accPtr(%4 : memref) to varPtr(%b : memref) - acc.delete accPtr(%5 : memref) {dataClause = 6 } + acc.delete accPtr(%5 : memref) {dataClause = #acc } acc.declare_exit dataOperands(%0, %1, %2 : memref, memref, memref) - acc.delete accPtr(%0 : memref) {dataClause = 1 } - acc.delete accPtr(%1 : memref) {dataClause = 2 } - acc.copyout accPtr(%2 : memref) to varPtr(%c : memref) { dataClause = 3 } + acc.delete accPtr(%0 : memref) {dataClause = #acc } + acc.delete accPtr(%1 : memref) {dataClause = #acc } + acc.copyout accPtr(%2 : memref) to varPtr(%c : memref) { dataClause = #acc } return } @@ -1580,11 +1580,11 @@ // CHECK-LABEL: func.func @testdeclareop( // CHECK-SAME: %[[ARGA:.*]]: memref, %[[ARGB:.*]]: memref, %[[ARGC:.*]]: memref) // CHECK: %[[COPYIN:.*]] = acc.copyin varPtr(%[[ARGA]] : memref) -> memref -// CHECK-NEXT: %[[COPYINRO:.*]] = acc.copyin varPtr(%[[ARGB]] : memref) -> memref {dataClause = 2 : i64} -// CHECK-NEXT: %[[COPY:.*]] = acc.copyin varPtr(%[[ARGC]] : memref) -> memref {dataClause = 3 : i64} +// CHECK-NEXT: %[[COPYINRO:.*]] = acc.copyin varPtr(%[[ARGB]] : memref) -> memref {dataClause = #acc} +// CHECK-NEXT: %[[COPY:.*]] = acc.copyin varPtr(%[[ARGC]] : memref) -> memref {dataClause = #acc} // CHECK-NEXT: acc.declare_enter dataOperands(%[[COPYIN]], %[[COPYINRO]], %[[COPY]] : memref, memref, memref) // CHECK: %[[CREATE:.*]] = acc.create varPtr(%[[ARGA]] : memref) -> memref -// CHECK-NEXT: %[[COPYOUT:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref {dataClause = 4 : i64} +// CHECK-NEXT: %[[COPYOUT:.*]] = acc.create varPtr(%[[ARGB]] : memref) -> memref {dataClause = #acc} // CHECK-NEXT: %[[PRESENT:.*]] = acc.present varPtr(%[[ARGC]] : memref) -> memref // CHECK-NEXT: acc.declare_enter dataOperands(%[[CREATE]], %[[COPYOUT]], %[[PRESENT]] : memref, memref, memref) // CHECK: %[[DEVICEPTR:.*]] = acc.deviceptr varPtr(%[[ARGA]] : memref) -> memref @@ -1592,16 +1592,16 @@ // CHECK-NEXT: %[[LINK:.*]] = acc.declare_link varPtr(%[[ARGC]] : memref) -> memref // CHECK-NEXT: acc.declare_enter dataOperands(%[[DEVICEPTR]], %[[DEVICERES]], %[[LINK]] : memref, memref, memref) // CHECK: acc.declare_exit dataOperands(%[[DEVICERES]], %[[LINK]] : memref, memref) -// CHECK-NEXT: acc.delete accPtr(%[[DEVICERES]] : memref) {dataClause = 22 : i64} -// CHECK-NEXT: acc.delete accPtr(%[[LINK]] : memref) {dataClause = 23 : i64} +// CHECK-NEXT: acc.delete accPtr(%[[DEVICERES]] : memref) {dataClause = #acc} +// CHECK-NEXT: acc.delete accPtr(%[[LINK]] : memref) {dataClause = #acc} // CHECK: acc.declare_exit dataOperands(%[[CREATE]], %[[COPYOUT]], %[[PRESENT]] : memref, memref, memref) -// CHECK-NEXT: acc.delete accPtr(%[[CREATE]] : memref) {dataClause = 7 : i64} +// CHECK-NEXT: acc.delete accPtr(%[[CREATE]] : memref) {dataClause = #acc} // CHECK-NEXT: acc.copyout accPtr(%[[COPYOUT]] : memref) to varPtr(%[[ARGB]] : memref) -// CHECK-NEXT: acc.delete accPtr(%[[PRESENT]] : memref) {dataClause = 6 : i64} +// CHECK-NEXT: acc.delete accPtr(%[[PRESENT]] : memref) {dataClause = #acc} // CHECK: acc.declare_exit dataOperands(%[[COPYIN]], %[[COPYINRO]], %[[COPY]] : memref, memref, memref) -// CHECK-NEXT: acc.delete accPtr(%[[COPYIN]] : memref) {dataClause = 1 : i64} -// CHECK-NEXT: acc.delete accPtr(%[[COPYINRO]] : memref) {dataClause = 2 : i64} -// CHECK-NEXT: acc.copyout accPtr(%[[COPY]] : memref) to varPtr(%[[ARGC]] : memref) {dataClause = 3 : i64} +// CHECK-NEXT: acc.delete accPtr(%[[COPYIN]] : memref) {dataClause = #acc} +// CHECK-NEXT: acc.delete accPtr(%[[COPYINRO]] : memref) {dataClause = #acc} +// CHECK-NEXT: acc.copyout accPtr(%[[COPY]] : memref) to varPtr(%[[ARGC]] : memref) {dataClause = #acc} // ----- @@ -1619,7 +1619,7 @@ acc.global_dtor @acc_destructor { %0 = llvm.mlir.addressof @globalvar : !llvm.ptr - %1 = acc.getdeviceptr varPtr(%0 : !llvm.ptr) -> !llvm.ptr { dataClause = 7} + %1 = acc.getdeviceptr varPtr(%0 : !llvm.ptr) -> !llvm.ptr { dataClause = #acc} acc.declare_exit dataOperands(%1 : !llvm.ptr) acc.delete accPtr(%1 : !llvm.ptr) acc.terminator @@ -1631,6 +1631,6 @@ // CHECK-NEXT: acc.declare_enter dataOperands(%[[CREATE]] : !llvm.ptr) // CHECK: acc.global_dtor @acc_destructor // CHECK: %[[ADDR:.*]] = llvm.mlir.addressof @globalvar : !llvm.ptr -// CHECK-NEXT: %[[DELETE:.*]] = acc.getdeviceptr varPtr(%[[ADDR]] : !llvm.ptr) -> !llvm.ptr {dataClause = 7 : i64} +// CHECK-NEXT: %[[DELETE:.*]] = acc.getdeviceptr varPtr(%[[ADDR]] : !llvm.ptr) -> !llvm.ptr {dataClause = #acc} // CHECK-NEXT: acc.declare_exit dataOperands(%[[DELETE]] : !llvm.ptr) // CHECK-NEXT: acc.delete accPtr(%[[DELETE]] : !llvm.ptr)