Skip to content

Commit 0c4d7d1

Browse files
committed
[mlir][openacc] Add ReturnLike trait to acc.yield operation
Just add the trait as acc.yield is a return like op. Reviewed By: razvanlupusoru, jeanPerier Differential Revision: https://reviews.llvm.org/D150617
1 parent 33da608 commit 0c4d7d1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mlir/include/mlir/Dialect/OpenACC/OpenACC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "mlir/Dialect/OpenACC/OpenACCOpsDialect.h.inc"
2121
#include "mlir/Dialect/OpenACC/OpenACCOpsEnums.h.inc"
2222
#include "mlir/Dialect/OpenACC/OpenACCTypeInterfaces.h.inc"
23+
#include "mlir/Interfaces/ControlFlowInterfaces.h"
2324
#include "mlir/Interfaces/SideEffectInterfaces.h"
2425

2526
#define GET_TYPEDEF_CLASSES

mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#ifndef OPENACC_OPS
1414
#define OPENACC_OPS
1515

16+
include "mlir/Interfaces/ControlFlowInterfaces.td"
1617
include "mlir/Interfaces/SideEffectInterfaces.td"
1718
include "mlir/IR/BuiltinTypes.td"
1819
include "mlir/IR/EnumAttr.td"
@@ -859,7 +860,7 @@ def OpenACC_LoopOp : OpenACC_Op<"loop",
859860
}
860861

861862
// Yield operation for the acc.loop and acc.parallel operations.
862-
def OpenACC_YieldOp : OpenACC_Op<"yield", [Terminator,
863+
def OpenACC_YieldOp : OpenACC_Op<"yield", [ReturnLike, Terminator,
863864
ParentOneOf<["ParallelOp, LoopOp, SerialOp"]>]> {
864865
let summary = "Acc yield and termination operation";
865866

0 commit comments

Comments
 (0)