@@ -311,6 +311,18 @@ class CIRCosOpLowering : public mlir::OpConversionPattern<cir::CosOp> {
311
311
}
312
312
};
313
313
314
+ class CIRTanOpLowering : public mlir ::OpConversionPattern<cir::TanOp> {
315
+ public:
316
+ using OpConversionPattern<cir::TanOp>::OpConversionPattern;
317
+
318
+ mlir::LogicalResult
319
+ matchAndRewrite (cir::TanOp op, OpAdaptor adaptor,
320
+ mlir::ConversionPatternRewriter &rewriter) const override {
321
+ rewriter.replaceOpWithNewOp <mlir::math::TanOp>(op, adaptor.getSrc ());
322
+ return mlir::LogicalResult::success ();
323
+ }
324
+ };
325
+
314
326
class CIRSqrtOpLowering : public mlir ::OpConversionPattern<cir::SqrtOp> {
315
327
public:
316
328
using mlir::OpConversionPattern<cir::SqrtOp>::OpConversionPattern;
@@ -1418,8 +1430,8 @@ void populateCIRToMLIRConversionPatterns(mlir::RewritePatternSet &patterns,
1418
1430
CIRBitClrsbOpLowering, CIRBitFfsOpLowering, CIRBitParityOpLowering,
1419
1431
CIRIfOpLowering, CIRVectorCreateLowering, CIRVectorInsertLowering,
1420
1432
CIRVectorExtractLowering, CIRVectorCmpOpLowering, CIRACosOpLowering,
1421
- CIRASinOpLowering, CIRUnreachableOpLowering>(converter,
1422
- patterns.getContext ());
1433
+ CIRASinOpLowering, CIRUnreachableOpLowering, CIRTanOpLowering>(
1434
+ converter, patterns.getContext ());
1423
1435
}
1424
1436
1425
1437
static mlir::TypeConverter prepareTypeConverter () {
0 commit comments