LLVM 22.0.0git
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 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 48 of file AMDGPULibCalls.cpp.

Constructor & Destructor Documentation

◆ AMDGPULibCalls()

llvm::AMDGPULibCalls::AMDGPULibCalls ( )
default

References F, and FAM.

Member Function Documentation

◆ canIncreasePrecisionOfConstantFold()

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

Definition at line 419 of file AMDGPULibCalls.cpp.

References llvm::FPMathOperator::isFast().

Referenced by fold().

◆ fold()

bool AMDGPULibCalls::fold ( CallInst * CI)

Definition at line 635 of file AMDGPULibCalls.cpp.

References llvm::FastMathFlags::approxFunc(), B(), Call, canIncreasePrecisionOfConstantFold(), llvm::cannotBeOrderedLessThanZero(), llvm::cast(), llvm::dbgs(), llvm::dyn_cast(), 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::CallBase::getFunctionType(), llvm::AMDGPULibFunc::getId(), llvm::Instruction::getModule(), llvm::Intrinsic::getOrInsertDeclaration(), llvm::FunctionType::getParamType(), getPownType(), llvm::Value::getType(), llvm::isa(), llvm::AMDGPULibFunc::isCompatibleSignature(), isKnownIntegral(), llvm::CallBase::isNoBuiltin(), llvm::CallBase::isStrictFP(), LLVM_DEBUG, llvm::FastMathFlags::none(), llvm::CallBase::setArgOperand(), and llvm::CallBase::setCalledFunction().

◆ initFunction()

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

Definition at line 425 of file AMDGPULibCalls.cpp.

References F, and FAM.

◆ initNativeFuncs()

void AMDGPULibCalls::initNativeFuncs ( )

◆ isUnsafeFiniteOnlyMath()

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

◆ replaceCall() [1/2]

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

Definition at line 127 of file AMDGPULibCalls.cpp.

References llvm::cast(), I, and replaceCall().

◆ replaceCall() [2/2]

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

Definition at line 122 of file AMDGPULibCalls.cpp.

References I.

Referenced by replaceCall().

◆ useNative()


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