[mlir] Check FunctionOpInterface castable type
authorKai Sasaki <lewuathe@gmail.com>
Sat, 22 Apr 2023 03:39:50 +0000 (12:39 +0900)
committerKai Sasaki <lewuathe@gmail.com>
Sat, 22 Apr 2023 03:40:03 +0000 (12:40 +0900)
commite5f8cdd68527b718ecfcc4724e3358b34e5014e5
tree0a5112a14316a78367378b023f344bcd5832cda6
parent58dbbb0d80a178f3e67e7e13d43fddc306c96d92
[mlir] Check FunctionOpInterface castable type

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
mlir/lib/Transforms/Utils/DialectConversion.cpp
mlir/test/Transforms/test-legalize-type-conversion.mlir