As convertFuncOpTypes does not support other FuncOpInterface types, we should check the type to avoid assertion failure. The original issue was reported https://github.com/llvm/llvm-project/issues/61858.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D148873
static LogicalResult convertFuncOpTypes(FunctionOpInterface funcOp,
TypeConverter &typeConverter,
ConversionPatternRewriter &rewriter) {
- FunctionType type = funcOp.getFunctionType().cast<FunctionType>();
+ FunctionType type = dyn_cast<FunctionType>(funcOp.getFunctionType());
+ if (!type)
+ return failure();
// Convert the original function types.
TypeConverter::SignatureConversion result(type.getNumInputs());
"test.type_producer"() : () -> !test.test_rec<something, test_rec<something>>
return
}
+
+// -----
+
+// CHECK-LABEL: @unsupported_func_op_interface
+llvm.func @unsupported_func_op_interface() {
+ // CHECK: llvm.return
+ llvm.return
+}