LLVM  7.0.0
Classes | Namespaces | Macros | Functions | Variables
AMDGPULibCalls.cpp File Reference

This file does AMD library function optimizations. More...

#include "AMDGPU.h"
#include "AMDGPULibFunc.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/Loads.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ValueSymbolTable.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetOptions.h"
#include <vector>
#include <cmath>
Include dependency graph for AMDGPULibCalls.cpp:

Go to the source code of this file.

Classes

class  llvm::AMDGPULibCalls
 
struct  TableRef
 

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define DEBUG_TYPE   "amdgpu-simplifylib"
 
#define MATH_PI   3.14159265358979323846264338327950288419716939937511
 
#define MATH_E   2.71828182845904523536028747135266249775724709369996
 
#define MATH_SQRT2   1.41421356237309504880168872420969807856967187537695
 
#define MATH_LOG2E   1.4426950408889634073599246810018921374266459541529859
 
#define MATH_LOG10E   0.4342944819032518276511289189166050822943970058036665
 
#define MATH_LOG2_10   3.3219280948873623478703194294893901758648313930245806
 
#define MATH_RLOG2_10   0.3010299956639811952137388947244930267681898814621085
 
#define MATH_RLOG2_E   0.6931471805599453094172321214581765680755001343602552
 

Functions

 INITIALIZE_PASS_BEGIN (AMDGPUSimplifyLibCalls, "amdgpu-simplifylib", "Simplify well-known AMD library calls", false, false) INITIALIZE_PASS_END(AMDGPUSimplifyLibCalls
 
amdgpu Simplify well known AMD library false INITIALIZE_PASS (AMDGPUUseNativeCalls, "amdgpu-usenative", "Replace builtin math calls with that native versions.", false, false) template< typename IRB > static CallInst *CreateCallEx(IRB &B
 
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 double llvm::log2 (double V)
 
static bool setFastFlags (Function &F, const TargetOptions &Options)
 

Variables

static cl::opt< bool > EnablePreLink ("amdgpu-prelink", cl::desc("Enable pre-link mode optimizations"), cl::init(false), cl::Hidden)
 
static cl::list< std::string > UseNative ("amdgpu-use-native", cl::desc("Comma separated list of functions to replace with native, or all"), cl::CommaSeparated, cl::ValueOptional, cl::Hidden)
 
amdgpu simplifylib
 
amdgpu Simplify well known AMD library calls
 
amdgpu Simplify well known AMD library false
 
amdgpu Simplify well known AMD library false Value * Callee
 
amdgpu Simplify well known AMD library false Value Value * Arg
 
amdgpu Simplify well known AMD library false Value Value const Twine & Name
 
static const TableEntry tbl_acos []
 
static const TableEntry tbl_acosh []
 
static const TableEntry tbl_acospi []
 
static const TableEntry tbl_asin []
 
static const TableEntry tbl_asinh []
 
static const TableEntry tbl_asinpi []
 
static const TableEntry tbl_atan []
 
static const TableEntry tbl_atanh []
 
static const TableEntry tbl_atanpi []
 
static const TableEntry tbl_cbrt []
 
static const TableEntry tbl_cos []
 
static const TableEntry tbl_cosh []
 
static const TableEntry tbl_cospi []
 
static const TableEntry tbl_erfc []
 
static const TableEntry tbl_erf []
 
static const TableEntry tbl_exp []
 
static const TableEntry tbl_exp2 []
 
static const TableEntry tbl_exp10 []
 
static const TableEntry tbl_expm1 []
 
static const TableEntry tbl_log []
 
static const TableEntry tbl_log2 []
 
static const TableEntry tbl_log10 []
 
static const TableEntry tbl_rsqrt []
 
static const TableEntry tbl_sin []
 
static const TableEntry tbl_sinh []
 
static const TableEntry tbl_sinpi []
 
static const TableEntry tbl_sqrt []
 
static const TableEntry tbl_tan []
 
static const TableEntry tbl_tanh []
 
static const TableEntry tbl_tanpi []
 
static const TableEntry tbl_tgamma []
 

Detailed Description

This file does AMD library function optimizations.

Definition in file AMDGPULibCalls.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "amdgpu-simplifylib"

Definition at line 15 of file AMDGPULibCalls.cpp.

◆ MATH_E

#define MATH_E   2.71828182845904523536028747135266249775724709369996

Definition at line 50 of file AMDGPULibCalls.cpp.

◆ MATH_LOG10E

#define MATH_LOG10E   0.4342944819032518276511289189166050822943970058036665

Definition at line 54 of file AMDGPULibCalls.cpp.

◆ MATH_LOG2_10

#define MATH_LOG2_10   3.3219280948873623478703194294893901758648313930245806

Definition at line 56 of file AMDGPULibCalls.cpp.

◆ MATH_LOG2E

#define MATH_LOG2E   1.4426950408889634073599246810018921374266459541529859

Definition at line 53 of file AMDGPULibCalls.cpp.

◆ MATH_PI

#define MATH_PI   3.14159265358979323846264338327950288419716939937511

Definition at line 49 of file AMDGPULibCalls.cpp.

◆ MATH_RLOG2_10

#define MATH_RLOG2_10   0.3010299956639811952137388947244930267681898814621085

Definition at line 58 of file AMDGPULibCalls.cpp.

◆ MATH_RLOG2_E

#define MATH_RLOG2_E   0.6931471805599453094172321214581765680755001343602552

Definition at line 60 of file AMDGPULibCalls.cpp.

◆ MATH_SQRT2

#define MATH_SQRT2   1.41421356237309504880168872420969807856967187537695

Definition at line 51 of file AMDGPULibCalls.cpp.

Function Documentation

◆ getArgType()

static AMDGPULibFunc::EType getArgType ( const AMDGPULibFunc &  FInfo)
inlinestatic

◆ getOptTable()

static TableRef getOptTable ( AMDGPULibFunc::EFuncId  id)
static

◆ getVecSize()

static int getVecSize ( const AMDGPULibFunc &  FInfo)
inlinestatic

◆ HasNative()

static bool HasNative ( AMDGPULibFunc::EFuncId  id)
static

◆ INITIALIZE_PASS()

amdgpu Simplify well known AMD library false INITIALIZE_PASS ( AMDGPUUseNativeCalls  ,
"amdgpu-usenative"  ,
"Replace builtin math calls with that native versions."  ,
false  ,
false   
) &

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( AMDGPUSimplifyLibCalls  ,
"amdgpu-simplifylib"  ,
"Simplify well-known AMD library calls"  ,
false  ,
false   
)

◆ setFastFlags()

static bool setFastFlags ( Function &  F,
const TargetOptions &  Options 
)
static

Variable Documentation

◆ Arg

amdgpu Simplify well known AMD library false Value Value* Arg

Definition at line 220 of file AMDGPULibCalls.cpp.

Referenced by llvm::AAEvaluator::AAEvaluator(), llvm::AAResults::AAResults(), llvm::opt::Option::accept(), AddAliasScopeMetadata(), AddAlignmentAssumptions(), addArgumentReturnedAttrs(), addConditions(), llvm::AnalysisUsage::addUsedIfAvailable(), addVCallToSet(), alwaysAvailable(), llvm::analyzeArguments(), llvm::CCState::AnalyzeArgumentsSecondPass(), llvm::AMDGPUTargetLowering::analyzeFormalArgumentsCompute(), AnalyzeReturnValues(), llvm::cl::basic_parser_impl::anchor(), llvm::MachineIRBuilderBase::buildAnyExt(), llvm::MachineIRBuilderBase::buildCast(), llvm::MachineIRBuilderBase::buildSExt(), llvm::MachineIRBuilderBase::buildZExt(), CalculateTailCallArgDest(), llvm::orc::rpc::ParallelCallGroup::call(), llvm::CallGraph::CallGraph(), CallingConvSupported(), CC_Lanai32_VarArg(), llvm::ARMTargetLowering::CCAssignFnForReturn(), CheckForCanReleaseCFGHazard(), checkFunctionMemoryAccess(), llvm::PriorityWorklist< llvm::LazyCallGraph::SCC *, SmallVector< llvm::LazyCallGraph::SCC *, N >, SmallDenseMap< llvm::LazyCallGraph::SCC *, ptrdiff_t > >::clear(), llvm::ScalarEvolution::clearFlags(), llvm::CoroIdInst::clearPromise(), computeCacheKey(), computeKnownBitsFromAssume(), ComputePostOrders(), llvm::ComputeSignatureVTs(), llvm::DwarfUnit::constructSubprogramArguments(), createCallInst(), createCast(), llvm::createDeadArgHackingPass(), llvm::AMDGPUTargetLowering::CreateLiveInRegisterRaw(), llvm::createObjCARCOptPass(), llvm::objcarc::Depends(), despeculateCountZeros(), llvm::dlltoolDriverMain(), llvm::DominatorTreeBase< BasicBlock, false >::DominatorTreeBase(), llvm::LazyValueInfo::enableDT(), EnsureStackAlignment(), findArgumentCopyElisionCandidates(), FindPredecessorRetainWithSafePath(), FindSingleUseIdentifiedObject(), llvm::VarDefInit::Fold(), llvm::FoldingSet< llvm::DIEAbbrev >::FoldingSet(), llvm::FoldingSetBase::FoldingSetBase(), llvm::FoldingSetImpl< llvm::DIEAbbrev >::FoldingSetImpl(), ForeachDagApply(), llvm::PPCTargetLowering::functionArgumentNeedsConsecutiveRegisters(), llvm::GlobalsAAResult::FunctionInfo::FunctionInfo(), llvm::DagInit::get(), llvm::DILocalVariable::getArg(), llvm::VarDefInit::getAsString(), getCompareCC(), getComparePred(), llvm::CoroSuspendInst::getCoroSave(), llvm::APFloat::getExactInverse(), llvm::SparcTargetLowering::getExceptionSelectorRegister(), llvm::AMDGPUSubtarget::getExplicitKernArgSize(), llvm::MemoryLocation::getForArgument(), llvm::cflaa::getGlobalOrArgAttrFromValue(), llvm::DenseMapInfo< MemoryLocOrCall >::getHashValue(), getInterfaceValue(), llvm::X86TargetLowering::getMaxSupportedInterleaveFactor(), llvm::AAResults::getModRefInfo(), getMOVL(), llvm::DiagnosticInfoOptimizationBase::getMsg(), getNarrowIntrinsic(), getNextIntArgReg(), llvm::DILocalScope::getNonLexicalBlockFileScope(), getOffsetFromIndices(), llvm::AMDGPU::getOperandSize(), llvm::MipsTargetLowering::getOpndList(), getOutputPath(), getParentPad(), llvm::CoroIdInst::getPromise(), llvm::Pass::getResolver(), getRetComponentType(), GetRMWLibcall(), getSearchPaths(), llvm::ARM_AM::getSOImmVal(), getSuccPad(), llvm::ARCTargetLowering::getTargetNodeName(), llvm::CallLowering::getTLI(), getUnderlyingArgReg(), llvm::GlobalsAAResult::GlobalsAAResult(), HandleByValArgument(), handlePhiDef(), hasAnyNonFlatUseOfReg(), llvm::CallSiteBase<>::hasArgument(), hasOnlySelectUsers(), llvm::ARMTargetLowering::hasStandaloneRem(), llvm::HexagonEvaluator::HexagonEvaluator(), INITIALIZE_PASS(), initSlots2Values(), llvm::yaml::CustomMappingTraits< std::map< std::vector< uint64_t >, WholeProgramDevirtResolution::ByArg > >::inputOne(), insertIfNamed(), insertParsePoints(), insertSinCosCall(), llvm::SIInstrInfo::insertWaitStates(), instrumentMaskedLoadOrStore(), llvm::PreservedAnalyses::intersect(), isBLACompatibleAddress(), isBroadcastShuffle(), isDynamicConstant(), llvm::DenseMapInfo< VTableSlot >::isEqual(), isIntExtFree(), isKnownNonNullFromDominatingCondition(), isMulPowOf2(), llvm::detail::IEEEFloat::isNegZero(), isOrdered(), llvm::DILocalVariable::isParameter(), isPermutation(), llvm::objcarc::IsPotentialRetainableObjPtr(), isReassociableOp(), llvm::APInt::isSameValue(), isSExtLoad(), isSortedByValueNo(), llvm::NVPTXTTIImpl::isSourceOfDivergence(), isSupportedType(), llvm::Value::isSwiftError(), llvm::SITargetLowering::isTypeDesirableForOp(), llvm::AMDGPUInstrInfo::isUniformMMO(), llvm::LazyValueInfo::LazyValueInfo(), LLVMGetNextParam(), LLVMGetPreviousParam(), LLVMSetParamAlignment(), LookupNearestOption(), llvm::LoopInfoBase< BasicBlock, Loop >::LoopInfoBase(), LowerADDSUBCARRY(), llvm::ARMCallLowering::lowerCall(), llvm::MipsCallLowering::lowerCall(), llvm::HexagonTargetLowering::LowerCall(), llvm::CallLowering::lowerCall(), llvm::SITargetLowering::LowerCall(), llvm::SparcTargetLowering::LowerCall_32(), llvm::SparcTargetLowering::LowerCall_64(), LowerCallResult(), llvm::FastISel::lowerCallTo(), llvm::SparcTargetLowering::LowerF128_LibCallArg(), llvm::X86CallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::R600TargetLowering::LowerFormalArguments(), llvm::MipsCallLowering::lowerFormalArguments(), llvm::SITargetLowering::LowerFormalArguments(), llvm::NVPTXTargetLowering::LowerFormalArguments(), llvm::SparcTargetLowering::LowerFormalArguments_32(), llvm::SparcTargetLowering::LowerFormalArguments_64(), LowerFSINCOS(), LowerInterruptReturn(), llvm::BPFTargetLowering::LowerOperation(), llvm::ARMCallLowering::lowerReturn(), llvm::SITargetLowering::LowerReturn(), llvm::SparcTargetLowering::LowerReturn_32(), LowerVectorINT_TO_FP(), makeStatepointExplicitImpl(), llvm::coro::LowererBase::makeSubFnCall(), markTails(), MatchingStackOffset(), maybePrintComdat(), mayTailCallThisCC(), needsFPFromSig(), onlySingleValue(), llvm::GVNExpression::BasicExpression::op_push_back(), llvm::cl::SubCommand::operator bool(), llvm::orc::rpc::detail::ReadArgs< ArgT, ArgTs... >::operator()(), llvm::operator<<(), llvm::LazyValueInfo::operator=(), llvm::yaml::CustomMappingTraits< std::map< std::vector< uint64_t >, WholeProgramDevirtResolution::ByArg > >::output(), llvm::cflaa::parentFunctionOfValue(), llvm::LTOCodeGenerator::parseCodeGenDebugOptions(), ParseFunctionArgs(), llvm::parseFunctionArgs(), llvm::opt::OptTable::ParseOneArg(), llvm::cl::parser< bool >::parser(), llvm::cl::parser< boolOrDefault >::parser(), llvm::cl::parser< int >::parser(), llvm::cl::parser< unsigned >::parser(), llvm::cl::parser< unsigned long long >::parser(), llvm::cl::parser< double >::parser(), llvm::cl::parser< float >::parser(), false::LibCallsShrinkWrap::perform(), llvm::R600TargetLowering::PerformDAGCombine(), llvm::AMDGPUAAResult::pointsToConstantMemory(), populateExternalRelations(), PrepareCall(), llvm::DivergenceAnalysis::print(), processDbgDeclares(), ProfileDagInit(), llvm::promoteCall(), PropagateConstantsIntoArguments(), PushArgMD(), regionReader(), llvm::R600TargetLowering::ReplaceNodeResults(), replaceShuffleOfInsert(), llvm::VarDefInit::resolveReferences(), llvm::DagInit::resolveReferences(), llvm::LoopAnalysisManagerFunctionProxy::Result<>::Result(), llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs >::Result::Result(), llvm::APIntOps::RoundFloatToAPInt(), llvm::WholeProgramDevirtPass::run(), llvm::runFuzzerOnInputs(), llvm::IRTranslator::runOnMachineFunction(), llvm::ScalarEvolution::ScalarEvolution(), llvm::FastISel::selectIntrinsicCall(), selectJumpTableArmEncoding(), llvm::SetVector< llvm::PHINode *, llvm::SmallVector< llvm::PHINode *, 2 > >::set_subtract(), llvm::CallLowering::setArgFlags(), llvm::LoopVectorizeHints::setPotentiallyUnsafe(), llvm::SIMachineFunctionInfo::setWorkItemIDX(), llvm::SIMachineFunctionInfo::setWorkItemIDY(), llvm::SIMachineFunctionInfo::setWorkItemIDZ(), shouldKeepInEntry(), ShrinkDemandedConstant(), simplifyInvariantGroupIntrinsic(), simplifyX86movmsk(), simplifyX86round(), StackMallocSizeClass(), StoreTailCallArgumentsToStackSlot(), truncateToSize(), tryToElideArgumentCopy(), unpackF64OnRV32DSoftABI(), llvm::UpgradeIntrinsicCall(), llvm::LoopVectorizeHints::vectorizeAnalysisPassName(), llvm::InstCombiner::visitCallInst(), llvm::ObjectSizeOffsetVisitor::visitCallSite(), llvm::codeview::TypeDumpVisitor::visitMemberEnd(), llvm::InnerLoopVectorizer::widenInstruction(), and X86ChooseCmpImmediateOpcode().

◆ Callee

amdgpu Simplify well known AMD library false Value* Callee

Definition at line 220 of file AMDGPULibCalls.cpp.

Referenced by llvm::AArch64TTIImpl::AArch64TTIImpl(), addEdge(), addNoRecurseAttrs(), addStackMapLiveVars(), allCallersPassInValidPointerForArgument(), llvm::analyzeArguments(), analyzeLoopUnrollCost(), AnalyzeReturnValues(), areCallingConvEligibleForTCO_64SVR4(), llvm::ARMTTIImpl::ARMTTIImpl(), llvm::AVRDAGToDAGISel::select< AVRISD::CALL >(), buildCGN(), CalculateTailCallSPDiff(), CallingConvSupported(), callsiteIsHot(), callsShareTOCBase(), CC_Lanai32_VarArg(), CC_MipsO32_FP64(), llvm::ARMTargetLowering::CCAssignFnForReturn(), computeBytesPoppedByCalleeForSRet(), computeFunctionSummary(), copyFeaturesToFunction(), llvm::createAlwaysInlinerLegacyPass(), llvm::createAMDGPUFunctionInliningPass(), llvm::IRBuilder< TargetFolder >::CreateCall(), DeleteBasicBlock(), doCallSiteSplitting(), llvm::emitBinaryFloatFnCall(), EmitHiLo(), llvm::MipsSETargetLowering::EmitInstrWithCustomInserter(), emitSignedInt64(), llvm::emitUnaryFloatFnCall(), llvm::Evaluator::EvaluateBlock(), ExpandBVWithShuffles(), findInitTrampoline(), llvm::sampleprof::FunctionSamples::findInlinedFunctions(), FindUses(), llvm::PPCTargetLowering::functionArgumentNeedsConsecutiveRegisters(), llvm::MipsTargetLowering::getAddrGPRel(), getAllocationData(), getAllocationSize(), getCalledFunction(), getCompareCC(), getComparePred(), llvm::SparcTargetLowering::getExceptionSelectorRegister(), llvm::XCoreTargetLowering::getExceptionSelectorRegister(), llvm::getFunctionName(), llvm::X86TargetLowering::getMaxSupportedInterleaveFactor(), getMemCmpLoad(), llvm::GlobalsAAResult::getModRefBehavior(), getMOVL(), getOffsetFromIndices(), llvm::MipsTargetLowering::getOpndList(), llvm::AArch64InstrInfo::getOutliningType(), getPow(), llvm::NVPTXTargetLowering::getPrototype(), getReductionSDNode(), llvm::MSP430TargetLowering::getScalarShiftAmountTy(), llvm::AVRTargetLowering::getSetCCResultType(), getSignature(), getSuccPad(), llvm::ARCTargetLowering::getTargetNodeName(), llvm::GCNTTIImpl::getVectorSplitCost(), getX86SSEConditionCode(), hasAnyNonFlatUseOfReg(), hasProfileData(), llvm::ARMTargetLowering::hasStandaloneRem(), INITIALIZE_PASS(), InlineCallIfPossible(), inlineCallsImpl(), insertSinCosCall(), InstrBreaksNonThrowing(), instrumentOneFunc(), isADDADDMUL(), llvm::NVPTXTargetLowering::isCheapToSpeculateCtlz(), llvm::isFreeCall(), isLocallyOpenedFile(), isReturnNonNull(), llvm::isSafeToSpeculativelyExecute(), llvm::MipsSETargetLowering::isShuffleMaskLegal(), isUnconditionalBranch(), isValidVariableType(), isWrapperOnlyCall(), llvm::X86CallLowering::lowerCall(), llvm::ARMCallLowering::lowerCall(), llvm::AArch64CallLowering::lowerCall(), llvm::HexagonTargetLowering::LowerCall(), llvm::CallLowering::lowerCall(), llvm::SITargetLowering::LowerCall(), llvm::NVPTXTargetLowering::LowerCall(), llvm::SystemZTargetLowering::LowerCall(), llvm::SparcTargetLowering::LowerCall_32(), llvm::SparcTargetLowering::LowerCall_64(), LowerCallResult(), llvm::SelectionDAGBuilder::LowerCallSiteWithDeoptBundleImpl(), llvm::SelectionDAGBuilder::LowerDeoptimizeCall(), llvm::SparcTargetLowering::LowerF128Compare(), llvm::SparcTargetLowering::LowerF128Op(), llvm::SparcTargetLowering::LowerGlobalTLSAddress(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::BPFTargetLowering::LowerOperation(), llvm::AMDGPUTargetLowering::lowerUnhandledCall(), LowerVectorINT_TO_FP(), llvm::TargetLowering::makeLibCall(), markAliveBlocks(), MarkBlocksLiveIn(), MatchingStackOffset(), mayTailCallThisCC(), optimizeBinaryDoubleFP(), optimizeUnaryDoubleFP(), false::LibCallsShrinkWrap::perform(), llvm::SelectionDAGBuilder::populateCallLoweringInfo(), PrepareCall(), llvm::CallGraphNode::removeCallEdge(), llvm::AAEvaluator::run(), llvm::InlinerPass::run(), llvm::DAGTypeLegalizer::run(), runImpl(), llvm::FastISel::selectStackmap(), llvm::SelectionDAGBuilder::setUnusedArgValue(), shouldInline(), shouldInstrumentBlock(), simplifySuspendPoint(), stripModuloOnShift(), llvm::AArch64TargetLowering::supportSwiftError(), unpackF64OnRV32DSoftABI(), llvm::coro::updateCallGraph(), UpdateCallGraphAfterInlining(), llvm::updateCGAndAnalysisManagerForFunctionPass(), useSinCos(), versionCallSite(), llvm::SelectionDAGBuilder::visitBitTestCase(), llvm::sampleprof::SampleProfileWriterBinary::writeBody(), X86ChooseCmpImmediateOpcode(), llvm::X86TTIImpl::X86TTIImpl(), and llvm::CallGraph::~CallGraph().

◆ calls

amdgpu Simplify well known AMD library calls

Definition at line 212 of file AMDGPULibCalls.cpp.

◆ EnablePreLink

cl::opt<bool> EnablePreLink("amdgpu-prelink", cl::desc("Enable pre-link mode optimizations"), cl::init(false), cl::Hidden)
static

Referenced by getArgType(), and setFastFlags().

◆ false

amdgpu Simplify well known AMD library false

Definition at line 212 of file AMDGPULibCalls.cpp.

Referenced by llvm::AMDGPULibCalls::fold().

◆ Name

amdgpu Simplify well known AMD library false Value Value const Twine& Name
Initial value:
= "") {
CallInst *R = B.CreateCall(Callee, Arg, Name);
if (Function* F = dyn_cast<Function>(Callee))
R->setCallingConv(F->getCallingConv());
return R;
}
template <typename IRB>
static CallInst *CreateCallEx2(IRB &B, Value *Callee, Value *Arg1, Value *Arg2,
const Twine &Name = "") {
CallInst *R = B.CreateCall(Callee, {Arg1, Arg2}, Name);
if (Function* F = dyn_cast<Function>(Callee))
R->setCallingConv(F->getCallingConv());
return R;
}
struct TableEntry {
double result;
double input;
}
This class represents a function call, abstracting a target machine&#39;s calling convention.
F(f)
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
amdgpu Simplify well known AMD library false Value * Callee
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void setCallingConv(CallingConv::ID CC)
amdgpu Simplify well known AMD library false Value Value * Arg
LLVM Value Representation.
Definition: Value.h:73

Definition at line 221 of file AMDGPULibCalls.cpp.

Referenced by llvm::AMDGPULibCalls::useNative().

◆ simplifylib

amdgpu simplifylib

Definition at line 212 of file AMDGPULibCalls.cpp.

◆ tbl_acos

const TableEntry tbl_acos[]
static
Initial value:
= {
{MATH_PI/2.0, 0.0},
{MATH_PI/2.0, -0.0},
{0.0, 1.0},
{MATH_PI, -1.0}
}
#define MATH_PI

Definition at line 246 of file AMDGPULibCalls.cpp.

◆ tbl_acosh

const TableEntry tbl_acosh[]
static
Initial value:
= {
{0.0, 1.0}
}

Definition at line 252 of file AMDGPULibCalls.cpp.

◆ tbl_acospi

const TableEntry tbl_acospi[]
static
Initial value:
= {
{0.5, 0.0},
{0.5, -0.0},
{0.0, 1.0},
{1.0, -1.0}
}

Definition at line 255 of file AMDGPULibCalls.cpp.

◆ tbl_asin

const TableEntry tbl_asin[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0},
{MATH_PI/2.0, 1.0},
{-MATH_PI/2.0, -1.0}
}
#define MATH_PI

Definition at line 261 of file AMDGPULibCalls.cpp.

◆ tbl_asinh

const TableEntry tbl_asinh[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0}
}

Definition at line 267 of file AMDGPULibCalls.cpp.

◆ tbl_asinpi

const TableEntry tbl_asinpi[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0},
{0.5, 1.0},
{-0.5, -1.0}
}

Definition at line 271 of file AMDGPULibCalls.cpp.

◆ tbl_atan

const TableEntry tbl_atan[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0},
{MATH_PI/4.0, 1.0},
{-MATH_PI/4.0, -1.0}
}
#define MATH_PI

Definition at line 277 of file AMDGPULibCalls.cpp.

◆ tbl_atanh

const TableEntry tbl_atanh[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0}
}

Definition at line 283 of file AMDGPULibCalls.cpp.

◆ tbl_atanpi

const TableEntry tbl_atanpi[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0},
{0.25, 1.0},
{-0.25, -1.0}
}

Definition at line 287 of file AMDGPULibCalls.cpp.

◆ tbl_cbrt

const TableEntry tbl_cbrt[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0},
{1.0, 1.0},
{-1.0, -1.0},
}

Definition at line 293 of file AMDGPULibCalls.cpp.

◆ tbl_cos

const TableEntry tbl_cos[]
static
Initial value:
= {
{1.0, 0.0},
{1.0, -0.0}
}

Definition at line 299 of file AMDGPULibCalls.cpp.

◆ tbl_cosh

const TableEntry tbl_cosh[]
static
Initial value:
= {
{1.0, 0.0},
{1.0, -0.0}
}

Definition at line 303 of file AMDGPULibCalls.cpp.

◆ tbl_cospi

const TableEntry tbl_cospi[]
static
Initial value:
= {
{1.0, 0.0},
{1.0, -0.0}
}

Definition at line 307 of file AMDGPULibCalls.cpp.

◆ tbl_erf

const TableEntry tbl_erf[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0}
}

Definition at line 315 of file AMDGPULibCalls.cpp.

◆ tbl_erfc

const TableEntry tbl_erfc[]
static
Initial value:
= {
{1.0, 0.0},
{1.0, -0.0}
}

Definition at line 311 of file AMDGPULibCalls.cpp.

◆ tbl_exp

const TableEntry tbl_exp[]
static
Initial value:
= {
{1.0, 0.0},
{1.0, -0.0},
{MATH_E, 1.0}
}
#define MATH_E

Definition at line 319 of file AMDGPULibCalls.cpp.

◆ tbl_exp10

const TableEntry tbl_exp10[]
static
Initial value:
= {
{1.0, 0.0},
{1.0, -0.0},
{10.0, 1.0}
}

Definition at line 329 of file AMDGPULibCalls.cpp.

◆ tbl_exp2

const TableEntry tbl_exp2[]
static
Initial value:
= {
{1.0, 0.0},
{1.0, -0.0},
{2.0, 1.0}
}

Definition at line 324 of file AMDGPULibCalls.cpp.

◆ tbl_expm1

const TableEntry tbl_expm1[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0}
}

Definition at line 334 of file AMDGPULibCalls.cpp.

◆ tbl_log

const TableEntry tbl_log[]
static
Initial value:
= {
{0.0, 1.0},
{1.0, MATH_E}
}
#define MATH_E

Definition at line 338 of file AMDGPULibCalls.cpp.

◆ tbl_log10

const TableEntry tbl_log10[]
static
Initial value:
= {
{0.0, 1.0},
{1.0, 10.0}
}

Definition at line 346 of file AMDGPULibCalls.cpp.

◆ tbl_log2

const TableEntry tbl_log2[]
static
Initial value:
= {
{0.0, 1.0},
{1.0, 2.0}
}

Definition at line 342 of file AMDGPULibCalls.cpp.

◆ tbl_rsqrt

const TableEntry tbl_rsqrt[]
static
Initial value:
= {
{1.0, 1.0},
{1.0/MATH_SQRT2, 2.0}
}
#define MATH_SQRT2

Definition at line 350 of file AMDGPULibCalls.cpp.

◆ tbl_sin

const TableEntry tbl_sin[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0}
}

Definition at line 354 of file AMDGPULibCalls.cpp.

◆ tbl_sinh

const TableEntry tbl_sinh[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0}
}

Definition at line 358 of file AMDGPULibCalls.cpp.

◆ tbl_sinpi

const TableEntry tbl_sinpi[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0}
}

Definition at line 362 of file AMDGPULibCalls.cpp.

◆ tbl_sqrt

const TableEntry tbl_sqrt[]
static
Initial value:
= {
{0.0, 0.0},
{1.0, 1.0},
{MATH_SQRT2, 2.0}
}
#define MATH_SQRT2

Definition at line 366 of file AMDGPULibCalls.cpp.

◆ tbl_tan

const TableEntry tbl_tan[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0}
}

Definition at line 371 of file AMDGPULibCalls.cpp.

◆ tbl_tanh

const TableEntry tbl_tanh[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0}
}

Definition at line 375 of file AMDGPULibCalls.cpp.

◆ tbl_tanpi

const TableEntry tbl_tanpi[]
static
Initial value:
= {
{0.0, 0.0},
{-0.0, -0.0}
}

Definition at line 379 of file AMDGPULibCalls.cpp.

◆ tbl_tgamma

const TableEntry tbl_tgamma[]
static
Initial value:
= {
{1.0, 1.0},
{1.0, 2.0},
{2.0, 3.0},
{6.0, 4.0}
}

Definition at line 383 of file AMDGPULibCalls.cpp.

◆ UseNative

cl::list<std::string> UseNative("amdgpu-use-native", cl::desc("Comma separated list of functions to replace with native, or all"), cl::CommaSeparated, cl::ValueOptional, cl::Hidden)
static