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 @@ -1305,12 +1305,20 @@ // ----- -func.func @host_device_ops(%a: memref<10xf32>) -> () { - %devptr = acc.getdeviceptr varPtr(%a : memref<10xf32>) -> memref<10xf32> {dataClause = 16} - acc.update_host accPtr(%devptr : memref<10xf32>) to varPtr(%a : memref<10xf32>) {structured = false} - acc.update dataOperands(%devptr : memref<10xf32>) +func.func @host_device_ops(%a: memref) -> () { + %devptr = acc.getdeviceptr varPtr(%a : memref) -> memref {dataClause = 16} + acc.update_host accPtr(%devptr : memref) to varPtr(%a : memref) {structured = false} + acc.update dataOperands(%devptr : memref) - %accPtr = acc.update_device varPtr(%a : memref<10xf32>) -> memref<10xf32> - acc.update dataOperands(%accPtr : memref<10xf32>) + %accPtr = acc.update_device varPtr(%a : memref) -> memref + acc.update dataOperands(%accPtr : memref) return } + +// CHECK-LABEL: func.func @host_device_ops( +// CHECK-SAME: %[[A:.*]]: memref) +// CHECK: %[[DEVPTR_A:.*]] = acc.getdeviceptr varPtr(%[[A]] : memref) -> memref +// CHECK: acc.update_host accPtr(%[[DEVPTR_A]] : memref) to varPtr(%[[A]] : memref) {structured = false} +// CHECK: acc.update dataOperands(%[[DEVPTR_A]] : memref) +// CHECK: %[[DEVPTR_A:.*]] = acc.update_device varPtr(%[[A]] : memref) -> memref +// CHECK: acc.update dataOperands(%[[DEVPTR_A]] : memref)