LLVM: lib/CodeGen/ReplaceWithVeclib.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "replace-with-veclib"
Functions
STATISTIC (NumCallsReplaced, "Number of calls to intrinsics that have been replaced.")
STATISTIC (NumTLIFuncDeclAdded, "Number of vector library function declarations added.")
STATISTIC (NumFuncUsedAdded, "Number of functions added to `llvm.compiler.used`")
Function * getTLIFunction (Module *M, FunctionType *VectorFTy, const StringRef TLIName, Function *ScalarFunc=nullptr)
Returns a vector Function that it adds to the Module M.
static void replaceWithTLIFunction (IntrinsicInst *II, VFInfo &Info, Function *TLIVecFunc)
Replace the intrinsic call II to TLIVecFunc, which is the corresponding function from the vector library.
static bool replaceWithCallToVeclib (const TargetLibraryInfo &TLI, IntrinsicInst *II)
Returns true when successfully replaced II, which is a call to a vectorized intrinsic, with a suitable function taking vector arguments, based on available mappings in the TLI.
static bool runImpl (const TargetLibraryInfo &TLI, Function &F)
INITIALIZE_PASS_BEGIN (ReplaceWithVeclibLegacy, DEBUG_TYPE, "Replace intrinsics with calls to vector library", false, false) INITIALIZE_PASS_END(ReplaceWithVeclibLegacy

DEBUG_TYPE

#define DEBUG_TYPE "replace-with-veclib"

getTLIFunction()

INITIALIZE_PASS_BEGIN()

replaceWithCallToVeclib()

Returns true when successfully replaced II, which is a call to a vectorized intrinsic, with a suitable function taking vector arguments, based on available mappings in the TLI.

Definition at line 100 of file ReplaceWithVeclib.cpp.

References assert(), llvm::VFABI::createFunctionType(), llvm::dbgs(), DEBUG_TYPE, llvm::dyn_cast(), llvm::enumerate(), llvm::FunctionType::get(), llvm::ElementCount::getFixed(), llvm::Intrinsic::getName(), llvm::Value::getName(), llvm::Type::getScalarType(), getTLIFunction(), llvm::VecDesc::getVectorFnName(), llvm::VecDesc::getVectorFunctionABIVariantString(), llvm::TargetLibraryInfo::getVectorMappingInfo(), llvm::GlobalPredicate, II, llvm::Intrinsic::isOverloaded(), llvm::isVectorIntrinsicWithOverloadTypeAtArg(), llvm::isVectorIntrinsicWithScalarOpAtArg(), llvm::Type::isVectorTy(), llvm::Type::isVoidTy(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceWithTLIFunction(), llvm::StringRef::str(), llvm::VFABI::tryDemangleForVFABI(), and llvm::Vector.

Referenced by runImpl().

replaceWithTLIFunction()

runImpl()

Definition at line 206 of file ReplaceWithVeclib.cpp.

References llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), F, I, II, instructions, llvm::Intrinsic::not_intrinsic, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and replaceWithCallToVeclib().

STATISTIC() [1/3]

STATISTIC ( NumCallsReplaced ,
"Number of calls to intrinsics that have been replaced." )

STATISTIC() [2/3]

STATISTIC ( NumFuncUsedAdded ,
"Number of functions added to `llvm.compiler.used`" )

STATISTIC() [3/3]

STATISTIC ( NumTLIFuncDeclAdded ,
"Number of vector library function declarations added." )

DEBUG_TYPE

false

library