LLVM 20.0.0git
Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
llvm::AMDGPULibCalls Class Reference

Public Member Functions

 AMDGPULibCalls ()=default
 
bool fold (CallInst *CI)
 
void initFunction (Function &F, FunctionAnalysisManager &FAM)
 
void initNativeFuncs ()
 
bool useNative (CallInst *CI)
 

Protected Member Functions

bool isUnsafeMath (const FPMathOperator *FPOp) const
 
bool isUnsafeFiniteOnlyMath (const FPMathOperator *FPOp) const
 
bool canIncreasePrecisionOfConstantFold (const FPMathOperator *FPOp) const
 

Static Protected Member Functions

static void replaceCall (Instruction *I, Value *With)
 
static void replaceCall (FPMathOperator *I, Value *With)
 

Detailed Description

Definition at line 52 of file AMDGPULibCalls.cpp.

Constructor & Destructor Documentation

◆ AMDGPULibCalls()

llvm::AMDGPULibCalls::AMDGPULibCalls ( )
default

Member Function Documentation

◆ canIncreasePrecisionOfConstantFold()

bool AMDGPULibCalls::canIncreasePrecisionOfConstantFold ( const FPMathOperator FPOp) const
protected

Definition at line 431 of file AMDGPULibCalls.cpp.

References isUnsafeMath().

Referenced by fold().

◆ fold()

bool AMDGPULibCalls::fold ( CallInst CI)

Definition at line 648 of file AMDGPULibCalls.cpp.

References llvm::FastMathFlags::approxFunc(), B, canIncreasePrecisionOfConstantFold(), llvm::cannotBeOrderedLessThanZero(), llvm::dbgs(), llvm::AMDGPULibFuncBase::EI_CEIL, llvm::AMDGPULibFuncBase::EI_COPYSIGN, llvm::AMDGPULibFuncBase::EI_COS, llvm::AMDGPULibFuncBase::EI_EXP, llvm::AMDGPULibFuncBase::EI_EXP2, llvm::AMDGPULibFuncBase::EI_FABS, llvm::AMDGPULibFuncBase::EI_FLOOR, llvm::AMDGPULibFuncBase::EI_FMA, llvm::AMDGPULibFuncBase::EI_FMAX, llvm::AMDGPULibFuncBase::EI_FMIN, llvm::AMDGPULibFuncBase::EI_LDEXP, llvm::AMDGPULibFuncBase::EI_LOG, llvm::AMDGPULibFuncBase::EI_LOG10, llvm::AMDGPULibFuncBase::EI_LOG2, llvm::AMDGPULibFuncBase::EI_MAD, llvm::AMDGPULibFuncBase::EI_POW, llvm::AMDGPULibFuncBase::EI_POWN, llvm::AMDGPULibFuncBase::EI_POWR, llvm::AMDGPULibFuncBase::EI_READ_PIPE_2, llvm::AMDGPULibFuncBase::EI_READ_PIPE_4, llvm::AMDGPULibFuncBase::EI_RINT, llvm::AMDGPULibFuncBase::EI_ROOTN, llvm::AMDGPULibFuncBase::EI_ROUND, llvm::AMDGPULibFuncBase::EI_SIN, llvm::AMDGPULibFuncBase::EI_SQRT, llvm::AMDGPULibFuncBase::EI_TRUNC, llvm::AMDGPULibFuncBase::EI_WRITE_PIPE_2, llvm::AMDGPULibFuncBase::EI_WRITE_PIPE_4, llvm::CallBase::getArgOperand(), llvm::CallBase::getCalledFunction(), llvm::Intrinsic::getDeclaration(), llvm::CallBase::getFunctionType(), llvm::AMDGPULibFunc::getId(), llvm::Instruction::getModule(), llvm::FunctionType::getParamType(), getPownType(), llvm::Value::getType(), llvm::AMDGPULibFunc::isCompatibleSignature(), isKnownIntegral(), llvm::CallBase::isNoBuiltin(), llvm::CallBase::isStrictFP(), LLVM_DEBUG, llvm::FastMathFlags::none(), llvm::CallBase::setArgOperand(), llvm::CallBase::setCalledFunction(), and llvm::AttributeFuncs::typeIncompatible().

Referenced by llvm::AMDGPUSimplifyLibCallsPass::run().

◆ initFunction()

void AMDGPULibCalls::initFunction ( Function F,
FunctionAnalysisManager FAM 
)

◆ initNativeFuncs()

void AMDGPULibCalls::initNativeFuncs ( )

◆ isUnsafeFiniteOnlyMath()

bool AMDGPULibCalls::isUnsafeFiniteOnlyMath ( const FPMathOperator FPOp) const
protected

◆ isUnsafeMath()

bool AMDGPULibCalls::isUnsafeMath ( const FPMathOperator FPOp) const
protected

Definition at line 422 of file AMDGPULibCalls.cpp.

References llvm::FPMathOperator::isFast().

Referenced by canIncreasePrecisionOfConstantFold().

◆ replaceCall() [1/2]

static void llvm::AMDGPULibCalls::replaceCall ( FPMathOperator I,
Value With 
)
inlinestaticprotected

Definition at line 134 of file AMDGPULibCalls.cpp.

References I, and replaceCall().

◆ replaceCall() [2/2]

static void llvm::AMDGPULibCalls::replaceCall ( Instruction I,
Value With 
)
inlinestaticprotected

Definition at line 129 of file AMDGPULibCalls.cpp.

References I.

Referenced by replaceCall().

◆ useNative()

bool AMDGPULibCalls::useNative ( CallInst CI)

The documentation for this class was generated from the following file: