MLIR 24.0.0git
MathToNVVM.cpp File Reference

Go to the source code of this file.

Classes

class  mlir::impl::ConvertMathToNVVMBase< DerivedT >
struct  SincosOpLowering

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::impl
 Attribute collections provide a dictionary-like interface.

Macros

#define GEN_PASS_DEF_CONVERTMATHTONVVM
#define DEBUG_TYPE   "math-to-nvvm"

Functions

std::unique_ptr<::mlir::Pass > mlir::impl::createConvertMathToNVVM ()
std::unique_ptr<::mlir::Pass > mlir::createConvertMathToNVVM ()
template<typename OpTy>
static void populateOpPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns, PatternBenefit benefit, StringRef f32Func, StringRef f64Func, StringRef f32ApproxFunc="", StringRef f16Func="")
template<typename OpTy>
static void populateIntOpPatterns (const LLVMTypeConverter &converter, RewritePatternSet &patterns, PatternBenefit benefit, StringRef i32Func)
static bool exponentFitsInI32 (math::FPowIOp op)
 libdevice's __nv_powi and __nv_powif take an i32 exponent, so math.fpowi with a wider or index exponent is not lowered.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "math-to-nvvm"

Definition at line 29 of file MathToNVVM.cpp.

◆ GEN_PASS_DEF_CONVERTMATHTONVVM

#define GEN_PASS_DEF_CONVERTMATHTONVVM

Definition at line 23 of file MathToNVVM.cpp.

Function Documentation

◆ exponentFitsInI32()

bool exponentFitsInI32 ( math::FPowIOp op)
static

libdevice's __nv_powi and __nv_powif take an i32 exponent, so math.fpowi with a wider or index exponent is not lowered.

Definition at line 54 of file MathToNVVM.cpp.

References mlir::getElementTypeOrSelf().

◆ populateIntOpPatterns()

template<typename OpTy>
void populateIntOpPatterns ( const LLVMTypeConverter & converter,
RewritePatternSet & patterns,
PatternBenefit benefit,
StringRef i32Func )
static

Definition at line 44 of file MathToNVVM.cpp.

References mlir::RewritePatternSet::add().

Referenced by mlir::populateLibDeviceConversionPatterns().

◆ populateOpPatterns()

template<typename OpTy>
void populateOpPatterns ( const LLVMTypeConverter & converter,
RewritePatternSet & patterns,
PatternBenefit benefit,
StringRef f32Func,
StringRef f64Func,
StringRef f32ApproxFunc = "",
StringRef f16Func = "" )
static

Definition at line 32 of file MathToNVVM.cpp.

References mlir::RewritePatternSet::add().

Referenced by mlir::populateLibDeviceConversionPatterns().