LLVM: lib/Transforms/Utils/InjectTLIMappings.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "inject-tli-mappings"
Functions
STATISTIC (NumCallInjected, "Number of calls in which the mappings have been injected.")
STATISTIC (NumVFDeclAdded, "Number of function declarations that have been added.")
STATISTIC (NumCompUsedAdded, "Number of `@llvm.compiler.used` operands that have been added.")
static void addVariantDeclaration (CallInst &CI, const ElementCount &VF, const VecDesc *VD)
A helper function that adds the vector variant declaration for vectorizing the CallInst CI with a vectorization factor of VF lanes.
static void addMappingsFromTLI (const TargetLibraryInfo &TLI, CallInst &CI)
static bool runImpl (const TargetLibraryInfo &TLI, Function &F)

DEBUG_TYPE

#define DEBUG_TYPE "inject-tli-mappings"

addMappingsFromTLI()

Definition at line 74 of file InjectTLIMappings.cpp.

References addVariantDeclaration(), llvm::SetVector< T, Vector, Set, N >::count(), llvm::StringRef::empty(), llvm::from_range, llvm::CallBase::getCalledFunction(), llvm::ElementCount::getFixed(), llvm::Function::getFunction(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::ElementCount::getScalable(), llvm::VecDesc::getVectorFnName(), llvm::VecDesc::getVectorFunctionABIVariantString(), llvm::TargetLibraryInfo::getVectorMappingInfo(), llvm::VFABI::getVectorVariantNames(), llvm::TargetLibraryInfo::getWidestVF(), llvm::TargetLibraryInfo::isFunctionVectorizable(), llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >::isKnownLE(), llvm::CallBase::isNoBuiltin(), llvm::Predicated, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::VFABI::setVectorVariantNames().

Referenced by runImpl().

addVariantDeclaration()

A helper function that adds the vector variant declaration for vectorizing the CallInst CI with a vectorization factor of VF lanes.

For each mapping, TLI provides a VABI prefix, which contains all information required to create vector function declaration.

Definition at line 40 of file InjectTLIMappings.cpp.

References llvm::appendToCompilerUsed(), assert(), llvm::Function::copyAttributesFrom(), llvm::Function::Create(), llvm::VFABI::createFunctionType(), llvm::dbgs(), DEBUG_TYPE, llvm::GlobalValue::ExternalLinkage, llvm::CallBase::getCalledFunction(), llvm::VecDesc::getCallingConv(), llvm::CallBase::getFunctionType(), llvm::Instruction::getModule(), llvm::VecDesc::getVectorFnName(), llvm::VecDesc::getVectorFunctionABIVariantString(), Info, LLVM_DEBUG, llvm::Function::setCallingConv(), llvm::Function::size(), and llvm::VFABI::tryDemangleForVFABI().

Referenced by addMappingsFromTLI().

runImpl()

STATISTIC() [1/3]

STATISTIC ( NumCallInjected ,
"Number of calls in which the mappings have been injected." )

STATISTIC() [2/3]

STATISTIC ( NumCompUsedAdded ,
"Number of `@llvm.compiler.used` operands that have been added." )

STATISTIC() [3/3]

STATISTIC ( NumVFDeclAdded ,
"Number of function declarations that have been added." )