@@ -316,6 +316,18 @@ class CIRCosOpLowering : public mlir::OpConversionPattern<cir::CosOp> {
316316 }
317317};
318318
319+ class CIRTanOpLowering : public mlir ::OpConversionPattern<cir::TanOp> {
320+ public:
321+ using OpConversionPattern<cir::TanOp>::OpConversionPattern;
322+
323+ mlir::LogicalResult
324+ matchAndRewrite (cir::TanOp op, OpAdaptor adaptor,
325+ mlir::ConversionPatternRewriter &rewriter) const override {
326+ rewriter.replaceOpWithNewOp <mlir::math::TanOp>(op, adaptor.getSrc ());
327+ return mlir::LogicalResult::success ();
328+ }
329+ };
330+
319331class CIRSqrtOpLowering : public mlir ::OpConversionPattern<cir::SqrtOp> {
320332public:
321333 using mlir::OpConversionPattern<cir::SqrtOp>::OpConversionPattern;
@@ -1446,8 +1458,8 @@ void populateCIRToMLIRConversionPatterns(mlir::RewritePatternSet &patterns,
14461458 CIRBitClrsbOpLowering, CIRBitFfsOpLowering, CIRBitParityOpLowering,
14471459 CIRIfOpLowering, CIRVectorCreateLowering, CIRVectorInsertLowering,
14481460 CIRVectorExtractLowering, CIRVectorCmpOpLowering, CIRACosOpLowering,
1449- CIRASinOpLowering, CIRUnreachableOpLowering>(converter,
1450- patterns.getContext ());
1461+ CIRASinOpLowering, CIRUnreachableOpLowering, CIRTanOpLowering>(
1462+ converter, patterns.getContext ());
14511463}
14521464
14531465static mlir::TypeConverter prepareTypeConverter () {
0 commit comments