diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACC.h b/mlir/include/mlir/Dialect/OpenACC/OpenACC.h --- a/mlir/include/mlir/Dialect/OpenACC/OpenACC.h +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACC.h @@ -20,6 +20,7 @@ #include "mlir/Dialect/OpenACC/OpenACCOpsDialect.h.inc" #include "mlir/Dialect/OpenACC/OpenACCOpsEnums.h.inc" #include "mlir/Dialect/OpenACC/OpenACCTypeInterfaces.h.inc" +#include "mlir/Interfaces/ControlFlowInterfaces.h" #include "mlir/Interfaces/SideEffectInterfaces.h" #define GET_TYPEDEF_CLASSES 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 @@ -13,6 +13,7 @@ #ifndef OPENACC_OPS #define OPENACC_OPS +include "mlir/Interfaces/ControlFlowInterfaces.td" include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/IR/BuiltinTypes.td" include "mlir/IR/EnumAttr.td" @@ -859,7 +860,7 @@ } // Yield operation for the acc.loop and acc.parallel operations. -def OpenACC_YieldOp : OpenACC_Op<"yield", [Terminator, +def OpenACC_YieldOp : OpenACC_Op<"yield", [ReturnLike, Terminator, ParentOneOf<["ParallelOp, LoopOp, SerialOp"]>]> { let summary = "Acc yield and termination operation";