Skip to content

Commit

Permalink
[aievec] Add missing conversion warnings for mac_elem and broadcast
Browse files Browse the repository at this point in the history
This patch is a first step towards enabling AIEVec to LLVM Dialect
conversion for AIEml intrinsics.
  • Loading branch information
jsetoain committed Sep 22, 2023
1 parent 067b00b commit afe87cb
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion lib/Conversion/AIEVecToLLVM/AIEVecToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,32 @@ class UnpackOpConversion
}
};

class BroadcastOpConversion
: public mlir::ConvertOpToLLVMPattern<aievec::BroadcastOp> {
public:
using ConvertOpToLLVMPattern<aievec::BroadcastOp>::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<aievec::FMAElemOp> {
public:
using ConvertOpToLLVMPattern<aievec::FMAElemOp>::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
Expand All @@ -703,7 +729,9 @@ void populateAIEVecToLLVMConversionPatterns(mlir::LLVMTypeConverter &converter,
ExtOpConversion,
SelectOpConversion,
PackOpConversion,
UnpackOpConversion>(converter);
UnpackOpConversion,
BroadcastOpConversion,
FMAElemOpConversion>(converter);
// clang-format on
}

Expand Down

0 comments on commit afe87cb

Please sign in to comment.