#include "mlir/Conversion/MathToLLVM/MathToLLVM.h"
#include "mlir/Conversion/ArithCommon/AttrToLLVMConverter.h"
#include "mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h"
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/Pattern.h"
#include "mlir/Conversion/LLVMCommon/VectorPattern.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/Math/IR/Math.h"
#include "mlir/IR/TypeUtilities.h"
#include "mlir/Pass/Pass.h"
namespace mlir {
#define GEN_PASS_DEF_CONVERTMATHTOLLVMPASS
#include "mlir/Conversion/Passes.h.inc"
}
usingnamespacemlir;
namespace {
ConvertFastMath;
ConvertFMFMathToLLVMPattern;
AbsFOpLowering;
CeilOpLowering;
CopySignOpLowering;
CosOpLowering;
CtPopFOpLowering;
Exp2OpLowering;
ExpOpLowering;
FloorOpLowering;
FmaOpLowering;
Log10OpLowering;
Log2OpLowering;
LogOpLowering;
PowFOpLowering;
FPowIOpLowering;
RoundEvenOpLowering;
RoundOpLowering;
SinOpLowering;
SqrtOpLowering;
FTruncOpLowering;
template <typename MathOp, typename LLVMOp>
struct IntOpWithFlagLowering : public ConvertOpToLLVMPattern<MathOp> { … };
CountLeadingZerosOpLowering;
CountTrailingZerosOpLowering;
AbsIOpLowering;
struct ExpM1OpLowering : public ConvertOpToLLVMPattern<math::ExpM1Op> { … };
struct Log1pOpLowering : public ConvertOpToLLVMPattern<math::Log1pOp> { … };
struct RsqrtOpLowering : public ConvertOpToLLVMPattern<math::RsqrtOp> { … };
struct ConvertMathToLLVMPass
: public impl::ConvertMathToLLVMPassBase<ConvertMathToLLVMPass> { … };
}
void mlir::populateMathToLLVMConversionPatterns(LLVMTypeConverter &converter,
RewritePatternSet &patterns,
bool approximateLog1p) { … }
namespace {
struct MathToLLVMDialectInterface : public ConvertToLLVMPatternInterface { … };
}
void mlir::registerConvertMathToLLVMInterface(DialectRegistry ®istry) { … }