|
32 | 32 | #include "mlir/IR/BuiltinTypes.h"
|
33 | 33 | #include "mlir/Pass/Pass.h"
|
34 | 34 | #include "mlir/Pass/PassManager.h"
|
| 35 | +#include "mlir/Support/LogicalResult.h" |
35 | 36 | #include "mlir/Target/LLVMIR/Dialect/Builtin/BuiltinToLLVMIRTranslation.h"
|
36 | 37 | #include "mlir/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.h"
|
37 | 38 | #include "mlir/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.h"
|
@@ -153,6 +154,18 @@ class CIRCosOpLowering : public mlir::OpConversionPattern<mlir::cir::CosOp> {
|
153 | 154 | }
|
154 | 155 | };
|
155 | 156 |
|
| 157 | +class CIRSinOpLowering : public mlir::OpConversionPattern<mlir::cir::SinOp> { |
| 158 | +public: |
| 159 | + using mlir::OpConversionPattern<mlir::cir::SinOp>::OpConversionPattern; |
| 160 | + |
| 161 | + mlir::LogicalResult |
| 162 | + matchAndRewrite(mlir::cir::SinOp op, OpAdaptor adaptor, |
| 163 | + mlir::ConversionPatternRewriter &rewriter) const override { |
| 164 | + rewriter.replaceOpWithNewOp<mlir::math::SinOp>(op, adaptor.getSrc()); |
| 165 | + return mlir::LogicalResult::success(); |
| 166 | + } |
| 167 | +}; |
| 168 | + |
156 | 169 | class CIRConstantOpLowering
|
157 | 170 | : public mlir::OpConversionPattern<mlir::cir::ConstantOp> {
|
158 | 171 | public:
|
@@ -847,7 +860,7 @@ void populateCIRToMLIRConversionPatterns(mlir::RewritePatternSet &patterns,
|
847 | 860 | CIRStoreOpLowering, CIRAllocaOpLowering, CIRFuncOpLowering,
|
848 | 861 | CIRScopeOpLowering, CIRBrCondOpLowering, CIRTernaryOpLowering,
|
849 | 862 | CIRYieldOpLowering, CIRCosOpLowering, CIRGlobalOpLowering,
|
850 |
| - CIRGetGlobalOpLowering, CIRCastOpLowering>( |
| 863 | + CIRGetGlobalOpLowering, CIRCastOpLowering, CIRSinOpLowering>( |
851 | 864 | converter, patterns.getContext());
|
852 | 865 | }
|
853 | 866 |
|
|
0 commit comments