From: Valentin Clement Date: Thu, 13 Apr 2023 21:35:02 +0000 (-0700) Subject: [mlir][openacc] Accept acc.serial has parent of acc.yield op X-Git-Tag: upstream/17.0.6~11688 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a21dfe1bd9fa18651676062dfe17feb71fe2344;p=platform%2Fupstream%2Fllvm.git [mlir][openacc] Accept acc.serial has parent of acc.yield op acc.serial op is modeled on the acc.parallel op. acc.yield operation must then accept acc.serial has a parent operation. Reviewed By: PeteSteinfeld, razvanlupusoru Differential Revision: https://reviews.llvm.org/D148258 --- diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td index f0f0acc..2bc4267 100644 --- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td @@ -497,7 +497,7 @@ def OpenACC_LoopOp : OpenACC_Op<"loop", [AttrSizedOperandSegments]> { // Yield operation for the acc.loop and acc.parallel operations. def OpenACC_YieldOp : OpenACC_Op<"yield", [Terminator, - ParentOneOf<["ParallelOp, LoopOp"]>]> { + ParentOneOf<["ParallelOp, LoopOp, SerialOp"]>]> { let summary = "Acc yield and termination operation"; let description = [{ diff --git a/mlir/test/Dialect/OpenACC/ops.mlir b/mlir/test/Dialect/OpenACC/ops.mlir index c659467..be014fd 100644 --- a/mlir/test/Dialect/OpenACC/ops.mlir +++ b/mlir/test/Dialect/OpenACC/ops.mlir @@ -530,6 +530,9 @@ func.func @testserialop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10 } attributes {waitAttr} acc.serial { } attributes {selfAttr} + acc.serial { + acc.yield + } attributes {selfAttr} return } @@ -577,6 +580,9 @@ func.func @testserialop(%a: memref<10xf32>, %b: memref<10xf32>, %c: memref<10x10 // CHECK-NEXT: } attributes {waitAttr} // CHECK: acc.serial { // CHECK-NEXT: } attributes {selfAttr} +// CHECK: acc.serial { +// CHECK: acc.yield +// CHECK-NEXT: } attributes {selfAttr} // -----