@@ -298,6 +298,14 @@ static Value createLinalgBodyCalculationForElementwiseOp(
298298 if (isa<tosa::ExpOp>(op) && isa<FloatType>(elementTy))
299299 return rewriter.create <mlir::math::ExpOp>(loc, resultTypes, args);
300300
301+ // tosa::SinOp
302+ if (isa<tosa::SinOp>(op) && isa<FloatType>(elementTy))
303+ return rewriter.create <mlir::math::SinOp>(loc, resultTypes, args);
304+
305+ // tosa::CosOp
306+ if (isa<tosa::CosOp>(op) && isa<FloatType>(elementTy))
307+ return rewriter.create <mlir::math::CosOp>(loc, resultTypes, args);
308+
301309 // tosa::TanhOp
302310 if (isa<tosa::TanhOp>(op) && isa<FloatType>(elementTy))
303311 return rewriter.create <mlir::math::TanhOp>(loc, resultTypes, args);
@@ -2598,6 +2606,8 @@ void mlir::tosa::populateTosaToLinalgConversionPatterns(
25982606 PointwiseConverter<tosa::LogOp>,
25992607 PointwiseConverter<tosa::ExpOp>,
26002608 PointwiseConverter<tosa::AbsOp>,
2609+ PointwiseConverter<tosa::SinOp>,
2610+ PointwiseConverter<tosa::CosOp>,
26012611 PointwiseConverter<tosa::TanhOp>,
26022612 PointwiseConverter<tosa::ErfOp>,
26032613 PointwiseConverter<tosa::BitwiseAndOp>,
0 commit comments