LLVM 23.0.0git
ReplaceWithVeclib.cpp File Reference

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`")
FunctiongetTLIFunction (Module *M, FunctionType *VectorFTy, const StringRef TLIName, std::optional< CallingConv::ID > CC, 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

Variables

 DEBUG_TYPE
Replace intrinsics with calls to vector library
Replace intrinsics with calls to vector false

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "replace-with-veclib"

Definition at line 35 of file ReplaceWithVeclib.cpp.

Function Documentation

◆ getTLIFunction()

Function * getTLIFunction ( Module * M,
FunctionType * VectorFTy,
const StringRef TLIName,
std::optional< CallingConv::ID > CC,
Function * ScalarFunc = nullptr )

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( ReplaceWithVeclibLegacy ,
DEBUG_TYPE ,
"Replace intrinsics with calls to vector library" ,
false ,
false  )

◆ replaceWithCallToVeclib()

◆ replaceWithTLIFunction()

void replaceWithTLIFunction ( IntrinsicInst * II,
VFInfo & Info,
Function * TLIVecFunc )
static

Replace the intrinsic call II to TLIVecFunc, which is the corresponding function from the vector library.

Definition at line 79 of file ReplaceWithVeclib.cpp.

References llvm::IRBuilderBase::CreateCall(), llvm::VectorType::get(), llvm::Constant::getAllOnesValue(), llvm::Function::getCallingConv(), llvm::Type::getInt1Ty(), II, llvm::IRBuilder(), and llvm::isa().

Referenced by replaceWithCallToVeclib().

◆ runImpl()

◆ 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."  )

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 284 of file ReplaceWithVeclib.cpp.

◆ false

Replace intrinsics with calls to vector false

Definition at line 285 of file ReplaceWithVeclib.cpp.

◆ library

Replace intrinsics with calls to vector library

Definition at line 285 of file ReplaceWithVeclib.cpp.