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 @@ -497,7 +497,7 @@ // 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 --- a/mlir/test/Dialect/OpenACC/ops.mlir +++ b/mlir/test/Dialect/OpenACC/ops.mlir @@ -530,6 +530,9 @@ } attributes {waitAttr} acc.serial { } attributes {selfAttr} + acc.serial { + acc.yield + } attributes {selfAttr} return } @@ -577,6 +580,9 @@ // CHECK-NEXT: } attributes {waitAttr} // CHECK: acc.serial { // CHECK-NEXT: } attributes {selfAttr} +// CHECK: acc.serial { +// CHECK: acc.yield +// CHECK-NEXT: } attributes {selfAttr} // -----