From afe87cb57077b6730db87d4f211d68803572ac7c Mon Sep 17 00:00:00 2001 From: Javier Setoain Date: Fri, 22 Sep 2023 03:49:25 -0600 Subject: [PATCH] [aievec] Add missing conversion warnings for mac_elem and broadcast This patch is a first step towards enabling AIEVec to LLVM Dialect conversion for AIEml intrinsics. --- lib/Conversion/AIEVecToLLVM/AIEVecToLLVM.cpp | 30 +++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/Conversion/AIEVecToLLVM/AIEVecToLLVM.cpp b/lib/Conversion/AIEVecToLLVM/AIEVecToLLVM.cpp index e05e6780df..17949f7e23 100644 --- a/lib/Conversion/AIEVecToLLVM/AIEVecToLLVM.cpp +++ b/lib/Conversion/AIEVecToLLVM/AIEVecToLLVM.cpp @@ -689,6 +689,32 @@ class UnpackOpConversion } }; +class BroadcastOpConversion + : public mlir::ConvertOpToLLVMPattern { +public: + using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern; + + LogicalResult + matchAndRewrite(aievec::BroadcastOp op, OpAdaptor adaptor, + ConversionPatternRewriter &rewriter) const override { + op.emitWarning() << "aie.broadcast conversion is not implemented\n"; + return failure(); + } +}; + +class FMAElemOpConversion + : public mlir::ConvertOpToLLVMPattern { +public: + using ConvertOpToLLVMPattern::ConvertOpToLLVMPattern; + + LogicalResult + matchAndRewrite(aievec::FMAElemOp op, OpAdaptor adaptor, + ConversionPatternRewriter &rewriter) const override { + op.emitWarning() << "aie.mac_elem conversion is not implemented\n"; + return failure(); + } +}; + void populateAIEVecToLLVMConversionPatterns(mlir::LLVMTypeConverter &converter, mlir::RewritePatternSet &patterns) { // clang-format off @@ -703,7 +729,9 @@ void populateAIEVecToLLVMConversionPatterns(mlir::LLVMTypeConverter &converter, ExtOpConversion, SelectOpConversion, PackOpConversion, - UnpackOpConversion>(converter); + UnpackOpConversion, + BroadcastOpConversion, + FMAElemOpConversion>(converter); // clang-format on }