@@ -279,6 +279,18 @@ class CIRStoreOpLowering : public mlir::OpConversionPattern<cir::StoreOp> {
279279 }
280280};
281281
282+ class CIRATanOpLowering : public mlir ::OpConversionPattern<cir::ATanOp> {
283+ public:
284+ using OpConversionPattern<cir::ATanOp>::OpConversionPattern;
285+
286+ mlir::LogicalResult
287+ matchAndRewrite (cir::ATanOp op, OpAdaptor adaptor,
288+ mlir::ConversionPatternRewriter &rewriter) const override {
289+ rewriter.replaceOpWithNewOp <mlir::math::AtanOp>(op, adaptor.getSrc ());
290+ return mlir::LogicalResult::success ();
291+ }
292+ };
293+
282294class CIRCosOpLowering : public mlir ::OpConversionPattern<cir::CosOp> {
283295public:
284296 using OpConversionPattern<cir::CosOp>::OpConversionPattern;
@@ -1356,22 +1368,23 @@ void populateCIRToMLIRConversionPatterns(mlir::RewritePatternSet &patterns,
13561368 mlir::TypeConverter &converter) {
13571369 patterns.add <CIRReturnLowering, CIRBrOpLowering>(patterns.getContext ());
13581370
1359- patterns.add <
1360- CIRCmpOpLowering, CIRCallOpLowering, CIRUnaryOpLowering, CIRBinOpLowering,
1361- CIRLoadOpLowering, CIRConstantOpLowering, CIRStoreOpLowering,
1362- CIRAllocaOpLowering, CIRFuncOpLowering, CIRScopeOpLowering,
1363- CIRBrCondOpLowering, CIRTernaryOpLowering, CIRYieldOpLowering,
1364- CIRCosOpLowering, CIRGlobalOpLowering, CIRGetGlobalOpLowering,
1365- CIRCastOpLowering, CIRPtrStrideOpLowering, CIRSqrtOpLowering,
1366- CIRCeilOpLowering, CIRExp2OpLowering, CIRExpOpLowering, CIRFAbsOpLowering,
1367- CIRAbsOpLowering, CIRFloorOpLowering, CIRLog10OpLowering,
1368- CIRLog2OpLowering, CIRLogOpLowering, CIRRoundOpLowering,
1369- CIRPtrStrideOpLowering, CIRSinOpLowering, CIRShiftOpLowering,
1370- CIRBitClzOpLowering, CIRBitCtzOpLowering, CIRBitPopcountOpLowering,
1371- CIRBitClrsbOpLowering, CIRBitFfsOpLowering, CIRBitParityOpLowering,
1372- CIRIfOpLowering, CIRVectorCreateLowering, CIRVectorInsertLowering,
1373- CIRVectorExtractLowering, CIRVectorCmpOpLowering>(converter,
1374- patterns.getContext ());
1371+ patterns
1372+ .add <CIRATanOpLowering, CIRCmpOpLowering, CIRCallOpLowering,
1373+ CIRUnaryOpLowering, CIRBinOpLowering, CIRLoadOpLowering,
1374+ CIRConstantOpLowering, CIRStoreOpLowering, CIRAllocaOpLowering,
1375+ CIRFuncOpLowering, CIRScopeOpLowering, CIRBrCondOpLowering,
1376+ CIRTernaryOpLowering, CIRYieldOpLowering, CIRCosOpLowering,
1377+ CIRGlobalOpLowering, CIRGetGlobalOpLowering, CIRCastOpLowering,
1378+ CIRPtrStrideOpLowering, CIRSqrtOpLowering, CIRCeilOpLowering,
1379+ CIRExp2OpLowering, CIRExpOpLowering, CIRFAbsOpLowering,
1380+ CIRAbsOpLowering, CIRFloorOpLowering, CIRLog10OpLowering,
1381+ CIRLog2OpLowering, CIRLogOpLowering, CIRRoundOpLowering,
1382+ CIRPtrStrideOpLowering, CIRSinOpLowering, CIRShiftOpLowering,
1383+ CIRBitClzOpLowering, CIRBitCtzOpLowering, CIRBitPopcountOpLowering,
1384+ CIRBitClrsbOpLowering, CIRBitFfsOpLowering, CIRBitParityOpLowering,
1385+ CIRIfOpLowering, CIRVectorCreateLowering, CIRVectorInsertLowering,
1386+ CIRVectorExtractLowering, CIRVectorCmpOpLowering>(
1387+ converter, patterns.getContext ());
13751388}
13761389
13771390static mlir::TypeConverter prepareTypeConverter () {
0 commit comments