-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Open
Labels
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);
}]