1 //===- MathToLibm.h - Utils to convert from the complex dialect --------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 #ifndef MLIR_CONVERSION_MATHTOLIBM_MATHTOLIBM_H_ 9 #define MLIR_CONVERSION_MATHTOLIBM_MATHTOLIBM_H_ 10 11 #include "mlir/IR/PatternMatch.h" 12 13 namespace mlir { 14 template <typename T> 15 class OperationPass; 16 17 #define GEN_PASS_DECL_CONVERTMATHTOLIBM 18 #include "mlir/Conversion/Passes.h.inc" 19 20 /// Populate the given list with patterns that convert from Math to Libm calls. 21 /// If log1pBenefit is present, use it instead of benefit for the Log1p op. 22 void populateMathToLibmConversionPatterns(RewritePatternSet &patterns); 23 24 /// Create a pass to convert Math operations to libm calls. 25 std::unique_ptr<OperationPass<ModuleOp>> createConvertMathToLibmPass(); 26 27 } // namespace mlir 28 29 #endif // MLIR_CONVERSION_MATHTOLIBM_MATHTOLIBM_H_ 30