LLVM
8.0.1
|
Public Member Functions | |
bool | fold (CallInst *CI, AliasAnalysis *AA=nullptr) |
void | initNativeFuncs () |
bool | useNative (CallInst *CI) |
Protected Member Functions | |
bool | isUnsafeMath (const CallInst *CI) const |
void | replaceCall (Value *With) |
Protected Attributes | |
CallInst * | CI |
Definition at line 64 of file AMDGPULibCalls.cpp.
bool AMDGPULibCalls::fold | ( | CallInst * | CI, |
AliasAnalysis * | AA = nullptr |
||
) |
Definition at line 636 of file AMDGPULibCalls.cpp.
References assert(), B, CI, Context, llvm::IRBuilder< T, Inserter >::CreateFDiv(), llvm::IRBuilder< T, Inserter >::CreateFMul(), llvm::dbgs(), llvm::dyn_cast(), llvm::AMDGPULibFuncBase::EI_COS, llvm::AMDGPULibFuncBase::EI_DIVIDE, llvm::AMDGPULibFuncBase::EI_FMA, llvm::AMDGPULibFuncBase::EI_MAD, llvm::AMDGPULibFuncBase::EI_NFMA, 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_RECIP, llvm::AMDGPULibFuncBase::EI_ROOTN, llvm::AMDGPULibFuncBase::EI_SIN, llvm::AMDGPULibFuncBase::EI_SQRT, llvm::AMDGPULibFuncBase::EI_WRITE_PIPE_2, llvm::AMDGPULibFuncBase::EI_WRITE_PIPE_4, llvm::errs(), llvm::AMDGPULibFuncBase::F32, llvm::AMDGPULibFuncBase::F64, false, llvm::ConstantFP::get(), llvm::ConstantDataVector::get(), llvm::CallBase::getArgOperand(), getArgType(), llvm::CallBase::getCalledFunction(), llvm::BasicBlock::getContext(), llvm::Function::getContext(), llvm::AMDGPULibFunc::getId(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::CallBase::getNumArgOperands(), llvm::AMDGPULibFunc::getNumArgs(), getOptTable(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::AMDGPULibFunc::getPrefix(), llvm::Value::getType(), getVecSize(), llvm::AMDGPULibFuncBase::HALF, HasNative(), llvm::ConstantFP::isExactlyValue(), isUnsafeMath(), LLVM_DEBUG, llvm::AMDGPULibFuncBase::NATIVE, llvm::AMDGPULibFuncBase::NOPFX, llvm::SmallVectorTemplateBase< T >::push_back(), replaceCall(), llvm::CallBase::setCalledFunction(), llvm::IRBuilderBase::setFastMathFlags(), llvm::IRBuilderBase::SetInsertPoint(), llvm::AMDGPULibFunc::setPrefix(), llvm::SmallVectorBase::size(), TableRef::size, and TableRef::table.
Referenced by replaceCall().
void AMDGPULibCalls::initNativeFuncs | ( | ) |
Definition at line 502 of file AMDGPULibCalls.cpp.
References llvm::AMDGPULibFuncBase::Param::ArgType, llvm::CallInst::Create(), llvm::dbgs(), DEBUG_WITH_TYPE, llvm::AMDGPULibFuncBase::EI_COS, llvm::AMDGPULibFuncBase::EI_SIN, llvm::CallBase::getArgOperand(), llvm::AMDGPULibFunc::getLeads(), llvm::Instruction::getModule(), llvm::AMDGPULibFuncBase::NATIVE, replaceCall(), llvm::AMDGPULibFunc::setId(), llvm::AMDGPULibFunc::setPrefix(), UseNative, and llvm::AMDGPULibFuncBase::Param::VectorSize.
Referenced by replaceCall().
Definition at line 488 of file AMDGPULibCalls.cpp.
References F(), llvm::find(), llvm::Function::getFnAttribute(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::Attribute::getValueAsString(), and UseNative.
Referenced by fold(), and llvm::log2().
|
inlineprotected |
Definition at line 150 of file AMDGPULibCalls.cpp.
References llvm::AnalysisUsage::addRequired(), llvm::Instruction::eraseFromParent(), F(), fold(), llvm::PassRegistry::getPassRegistry(), INITIALIZE_PASS_BEGIN(), INITIALIZE_PASS_DEPENDENCY, llvm::initializeAMDGPUSimplifyLibCallsPass(), llvm::initializeAMDGPUUseNativeCallsPass(), initNativeFuncs(), llvm::Value::replaceAllUsesWith(), runOnFunction(), and useNative().
Referenced by fold(), initNativeFuncs(), and llvm::log2().
Definition at line 542 of file AMDGPULibCalls.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), CI, llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreatePointerCast(), llvm::dbgs(), DEBUG_WITH_TYPE, llvm::User::dropAllReferences(), llvm::AMDGPULibFuncBase::EI_SINCOS, llvm::Instruction::eraseFromParent(), llvm::AMDGPULibFuncBase::F64, llvm::FunctionType::get(), llvm::VectorType::get(), llvm::PointerType::get(), llvm::CallBase::getArgOperand(), getArgType(), llvm::CallBase::getAttributes(), llvm::CallBase::getCalledFunction(), llvm::Value::getContext(), llvm::AMDGPULibFunc::getId(), llvm::Type::getInt64Ty(), llvm::Type::getIntNTy(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::AMDGPULibFunc::getName(), llvm::CallBase::getNumArgOperands(), llvm::AMDGPULibFunc::getOrInsertFunction(), llvm::Type::getPointerAddressSpace(), llvm::AMDGPULibFunc::getPrefix(), llvm::Value::getType(), llvm::Value::hasName(), HasNative(), I, llvm::AMDGPULibFunc::isMangled(), llvm::isPowerOf2_32(), Name, llvm::AMDGPULibFuncBase::NATIVE, llvm::AMDGPULibFuncBase::NOPFX, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::Value::replaceAllUsesWith(), llvm::CallBase::setAttributes(), llvm::CallBase::setCalledFunction(), llvm::AMDGPULibFunc::setPrefix(), Size, and llvm::to_string().
Referenced by replaceCall().
|
protected |
Definition at line 146 of file AMDGPULibCalls.cpp.
Referenced by fold(), and useNative().