diff --git a/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp b/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp --- a/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp +++ b/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp @@ -278,6 +278,17 @@ AsyncRuntimeTypeConverter() { addConversion([](Type type) { return type; }); addConversion(convertAsyncTypes); + + // Use UnrealizedConversionCast as the bridge so that we don't need to pull + // in patterns for other dialects. + auto addUnrealizedCast = [](OpBuilder &builder, Type type, + ValueRange inputs, Location loc) { + auto cast = builder.create(loc, type, inputs); + return Optional(cast.getResult(0)); + }; + + addSourceMaterialization(addUnrealizedCast); + addTargetMaterialization(addUnrealizedCast); } static Optional convertAsyncTypes(Type type) {