Open
Description
Currently ReturnLike
attaches RegionBranchTerminatorOpInterface
as a sub trait (see https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td#L384). Consequently, func::ReturnOp
implements RegionBranchTerminatorOpInterface
. However, func::FuncOp
doesn't implement RegionBranchOpInterface
(see https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Dialect/Func/IR/FuncOps.td#L226-L229), resulting on an assert produced by the default implementation of RegionBranchTerminatorOpInterface
:
"void", "getSuccessorRegions",
(ins "::llvm::ArrayRef<::mlir::Attribute>":$operands,
"::llvm::SmallVectorImpl<::mlir::RegionSuccessor> &":$regions), [{}],
/*defaultImplementation=*/[{
::mlir::Operation *op = $_op;
::llvm::cast<::mlir::RegionBranchOpInterface>(op->getParentOp())
.getSuccessorRegions(op->getParentRegion(), regions);
}]