[mlir] Catch nonconvertible types in async conversion

Reviewed By: ezhulenev, ftynse

Differential Revision: https://reviews.llvm.org/D103592
This commit is contained in:
Christian Sigg 2021-06-03 09:25:22 +02:00
parent 23a116c8c4
commit fd3f2518a4
1 changed files with 2 additions and 1 deletions

View File

@ -1059,7 +1059,8 @@ void mlir::populateAsyncStructuralTypeConversionsAndLegality(
ConversionTarget &target) {
typeConverter.addConversion([&](TokenType type) { return type; });
typeConverter.addConversion([&](ValueType type) {
return ValueType::get(typeConverter.convertType(type.getValueType()));
Type converted = typeConverter.convertType(type.getValueType());
return converted ? ValueType::get(converted) : converted;
});
patterns.add<ConvertExecuteOpTypes, ConvertAwaitOpTypes, ConvertYieldOpTypes>(