From d2a8a3af5e64a6dcfbe463311091d9e6b4d9c102 Mon Sep 17 00:00:00 2001 From: Eugene Zhulenev Date: Fri, 26 Aug 2022 15:38:41 -0700 Subject: [PATCH] [mlir] Async: add unrealized cast materializations to AsyncToLLVM pass [mlir] Async: add unrealized cast materializations to AsyncToLLVM pass Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D132768 --- mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp b/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp index aa6598c..26154e4 100644 --- a/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp +++ b/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp @@ -278,6 +278,17 @@ public: 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) { -- 2.7.4