|
LLVM 24.0.0git
|
This file does AMD library function optimizations. More...
#include "AMDGPU.h"#include "AMDGPULibFunc.h"#include "llvm/Analysis/AssumptionCache.h"#include "llvm/Analysis/TargetLibraryInfo.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/IR/AttributeMask.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/MDBuilder.h"#include "llvm/IR/PatternMatch.h"#include <cmath>Go to the source code of this file.
Classes | |
| class | llvm::AMDGPULibCalls |
| struct | TableEntry |
Namespaces | |
| namespace | llvm |
| This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
| #define | DEBUG_TYPE "amdgpu-simplifylib" |
| #define | MATH_PI numbers::pi |
| #define | MATH_E numbers::e |
| #define | MATH_SQRT2 numbers::sqrt2 |
| #define | MATH_SQRT1_2 numbers::inv_sqrt2 |
Typedefs | |
| using | TableRef = ArrayRef<TableEntry> |
Enumerations | |
| enum class | PowKind { Pow , PowR , PowN , RootN } |
Functions | |
| template<typename IRB> | |
| static CallInst * | CreateCallEx (IRB &B, FunctionCallee Callee, Value *Arg, const Twine &Name="") |
| template<typename IRB> | |
| static CallInst * | CreateCallEx2 (IRB &B, FunctionCallee Callee, Value *Arg1, Value *Arg2, const Twine &Name="") |
| static FunctionType * | getPownType (FunctionType *FT) |
| static bool | HasNative (AMDGPULibFunc::EFuncId id) |
| static TableRef | getOptTable (AMDGPULibFunc::EFuncId id) |
| static int | getVecSize (const AMDGPULibFunc &FInfo) |
| static AMDGPULibFunc::EType | getArgType (const AMDGPULibFunc &FInfo) |
| static Constant * | getConstantFloat (const ArrayRef< APFloat > Values, const Type *Ty) |
| static double | llvm::log2 (double V) |
| static Value * | emitIsInteger (IRBuilder<> &B, Value *Y) |
| static Value * | emitIsEvenInteger (IRBuilder<> &B, Value *Y) |
| static Value * | emitIsOddInteger (IRBuilder<> &B, Value *Y) |
| static Value * | emitIsInf (IRBuilder<> &B, Value *val) |
| static Value * | emitFastExpYLnx (IRBuilder<> &B, Value *X, Value *Y) |
| static Value * | emitPowFixup (IRBuilder<> &B, Value *X, Value *Y, Value *ExpYLnX, PowKind Kind) |
| Emit special case management epilog code for fast pow, powr, pown, and rootn expansions. | |
This file does AMD library function optimizations.
Definition in file AMDGPULibCalls.cpp.
| #define DEBUG_TYPE "amdgpu-simplifylib" |
Definition at line 26 of file AMDGPULibCalls.cpp.
| #define MATH_E numbers::e |
Definition at line 42 of file AMDGPULibCalls.cpp.
| #define MATH_PI numbers::pi |
Definition at line 41 of file AMDGPULibCalls.cpp.
| #define MATH_SQRT1_2 numbers::inv_sqrt2 |
Definition at line 44 of file AMDGPULibCalls.cpp.
| #define MATH_SQRT2 numbers::sqrt2 |
Definition at line 43 of file AMDGPULibCalls.cpp.
| using TableRef = ArrayRef<TableEntry> |
Definition at line 366 of file AMDGPULibCalls.cpp.
|
strong |
| Enumerator | |
|---|---|
| Pow | |
| PowR | |
| PowN | |
| RootN | |
Definition at line 46 of file AMDGPULibCalls.cpp.
|
static |
Definition at line 164 of file AMDGPULibCalls.cpp.
References B(), llvm::dyn_cast(), and F.
|
static |
Definition at line 173 of file AMDGPULibCalls.cpp.
References B(), llvm::dyn_cast(), and F.
Definition at line 1311 of file AMDGPULibCalls.cpp.
Definition at line 1290 of file AMDGPULibCalls.cpp.
References B(), emitIsInteger(), and Y.
Referenced by emitIsOddInteger().
Definition at line 1305 of file AMDGPULibCalls.cpp.
References B(), llvm::ConstantFP::getInfinity(), and llvm::Value::getType().
Referenced by emitPowFixup().
Definition at line 1285 of file AMDGPULibCalls.cpp.
Referenced by emitIsEvenInteger(), emitIsOddInteger(), and emitPowFixup().
Definition at line 1297 of file AMDGPULibCalls.cpp.
References B(), emitIsEvenInteger(), emitIsInteger(), and Y.
Referenced by emitPowFixup().
|
static |
Emit special case management epilog code for fast pow, powr, pown, and rootn expansions.
x and y should be the arguments to the library call (possibly with some values clamped). expylnx should be the result to use in normal circumstances.
Definition at line 1322 of file AMDGPULibCalls.cpp.
References B(), emitIsInf(), emitIsInteger(), emitIsOddInteger(), llvm::ConstantFP::getInfinity(), llvm::ConstantFP::getQNaN(), llvm::ConstantFP::getZero(), llvm_unreachable, Pow, PowN, PowR, RootN, X, and Y.
|
inlinestatic |
Definition at line 416 of file AMDGPULibCalls.cpp.
References llvm::AMDGPULibFuncBase::Param::ArgType, and llvm::AMDGPULibFunc::getLeads().
Referenced by llvm::AMDGPULibCalls::fold(), and llvm::AMDGPULibCalls::useNative().
Definition at line 804 of file AMDGPULibCalls.cpp.
References assert(), llvm::cast(), llvm::ConstantVector::get(), llvm::Type::getScalarType(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), llvm::APFloatBase::rmNearestTiesToEven, and llvm::Values.
|
static |
Definition at line 368 of file AMDGPULibCalls.cpp.
References llvm::AMDGPULibFuncBase::EI_ACOS, llvm::AMDGPULibFuncBase::EI_ACOSH, llvm::AMDGPULibFuncBase::EI_ACOSPI, llvm::AMDGPULibFuncBase::EI_ASIN, llvm::AMDGPULibFuncBase::EI_ASINH, llvm::AMDGPULibFuncBase::EI_ASINPI, llvm::AMDGPULibFuncBase::EI_ATAN, llvm::AMDGPULibFuncBase::EI_ATANH, llvm::AMDGPULibFuncBase::EI_ATANPI, llvm::AMDGPULibFuncBase::EI_CBRT, llvm::AMDGPULibFuncBase::EI_COS, llvm::AMDGPULibFuncBase::EI_COSH, llvm::AMDGPULibFuncBase::EI_COSPI, llvm::AMDGPULibFuncBase::EI_ERF, llvm::AMDGPULibFuncBase::EI_ERFC, llvm::AMDGPULibFuncBase::EI_EXP, llvm::AMDGPULibFuncBase::EI_EXP10, llvm::AMDGPULibFuncBase::EI_EXP2, llvm::AMDGPULibFuncBase::EI_EXPM1, llvm::AMDGPULibFuncBase::EI_LOG, llvm::AMDGPULibFuncBase::EI_LOG10, llvm::AMDGPULibFuncBase::EI_LOG2, llvm::AMDGPULibFuncBase::EI_NCOS, llvm::AMDGPULibFuncBase::EI_NEXP2, llvm::AMDGPULibFuncBase::EI_NLOG2, llvm::AMDGPULibFuncBase::EI_NRSQRT, llvm::AMDGPULibFuncBase::EI_NSIN, llvm::AMDGPULibFuncBase::EI_NSQRT, llvm::AMDGPULibFuncBase::EI_RSQRT, llvm::AMDGPULibFuncBase::EI_SIN, llvm::AMDGPULibFuncBase::EI_SINH, llvm::AMDGPULibFuncBase::EI_SINPI, llvm::AMDGPULibFuncBase::EI_SQRT, llvm::AMDGPULibFuncBase::EI_TAN, llvm::AMDGPULibFuncBase::EI_TANH, llvm::AMDGPULibFuncBase::EI_TANPI, llvm::AMDGPULibFuncBase::EI_TGAMMA, tbl_acos, tbl_acosh, tbl_acospi, tbl_asin, tbl_asinh, tbl_asinpi, tbl_atan, tbl_atanh, tbl_atanpi, tbl_cbrt, tbl_cos, tbl_cosh, tbl_cospi, tbl_erf, tbl_erfc, tbl_exp, tbl_exp10, tbl_exp2, tbl_expm1, tbl_log, tbl_log10, tbl_log2, tbl_rsqrt, tbl_sin, tbl_sinh, tbl_sinpi, tbl_sqrt, tbl_tan, tbl_tanh, tbl_tanpi, and tbl_tgamma.
|
static |
Definition at line 181 of file AMDGPULibCalls.cpp.
References llvm::dyn_cast(), llvm::FunctionType::get(), llvm::VectorType::get(), and llvm::Type::getInt32Ty().
|
inlinestatic |
Definition at line 412 of file AMDGPULibCalls.cpp.
References llvm::AMDGPULibFunc::getLeads(), and llvm::AMDGPULibFuncBase::Param::VectorSize.
|
static |
Definition at line 343 of file AMDGPULibCalls.cpp.
References llvm::AMDGPULibFuncBase::EI_COS, llvm::AMDGPULibFuncBase::EI_DIVIDE, llvm::AMDGPULibFuncBase::EI_EXP, llvm::AMDGPULibFuncBase::EI_EXP10, llvm::AMDGPULibFuncBase::EI_EXP2, llvm::AMDGPULibFuncBase::EI_LOG, llvm::AMDGPULibFuncBase::EI_LOG10, llvm::AMDGPULibFuncBase::EI_LOG2, llvm::AMDGPULibFuncBase::EI_POWR, llvm::AMDGPULibFuncBase::EI_RECIP, llvm::AMDGPULibFuncBase::EI_RSQRT, llvm::AMDGPULibFuncBase::EI_SIN, llvm::AMDGPULibFuncBase::EI_SINCOS, llvm::AMDGPULibFuncBase::EI_SQRT, and llvm::AMDGPULibFuncBase::EI_TAN.
Referenced by llvm::AMDGPULibCalls::useNative().
|
static |
|
static |
Definition at line 199 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 205 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 208 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 214 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 220 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 224 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 230 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 236 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 240 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 246 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 252 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 256 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 260 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 268 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 264 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 272 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 282 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 277 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 287 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 291 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 299 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 295 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 303 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 307 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 311 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 315 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 319 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 324 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 328 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 332 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |
Definition at line 336 of file AMDGPULibCalls.cpp.
Referenced by getOptTable().
|
static |