LLVM 17.0.0git
|
#include "llvm/Transforms/Utils/InjectTLIMappings.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/DemandedBits.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/VectorUtils.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
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, bool Predicate, const StringRef VFName) |
A helper function that adds the vector function declaration that vectorizes 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) |
#define DEBUG_TYPE "inject-tli-mappings" |
Definition at line 26 of file InjectTLIMappings.cpp.
|
static |
Definition at line 72 of file InjectTLIMappings.cpp.
References addVariantDeclaration(), llvm::CallBase::arg_size(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SetVector< T, Vector, Set >::count(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::CallBase::getCalledFunction(), llvm::ElementCount::getFixed(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::ElementCount::getScalable(), llvm::TargetLibraryInfo::getVectorizedFunction(), llvm::VFABI::getVectorVariantNames(), llvm::TargetLibraryInfo::getWidestVF(), llvm::TargetLibraryInfo::isFunctionVectorizable(), llvm::CallBase::isNoBuiltin(), llvm::VFABI::mangleTLIVectorName(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::VFABI::setVectorVariantNames().
Referenced by runImpl().
|
static |
A helper function that adds the vector function declaration that vectorizes the CallInst CI with a vectorization factor of VF lanes.
The TLI assumes that all parameters and the return type of CI (other than void) need to be widened to a VectorType of VF lanes.
Definition at line 41 of file InjectTLIMappings.cpp.
References llvm::appendToCompilerUsed(), llvm::CallBase::args(), assert(), llvm::Function::copyAttributesFrom(), llvm::Function::Create(), llvm::dbgs(), DEBUG_TYPE, llvm::CallBase::getCalledFunction(), llvm::CallBase::getFunctionType(), llvm::Type::getInt1Ty(), llvm::Instruction::getModule(), llvm::GlobalValue::getType(), llvm::Value::getType(), llvm::FunctionType::isVarArg(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), RetTy, llvm::Function::size(), and llvm::ToVectorTy().
Referenced by addMappingsFromTLI().
|
static |
Definition at line 126 of file InjectTLIMappings.cpp.
References addMappingsFromTLI(), F, I, and instructions.
STATISTIC | ( | NumCallInjected | , |
"Number of calls in which the mappings have been injected." | |||
) |
STATISTIC | ( | NumCompUsedAdded | , |
"Number of `@llvm.compiler.used` operands that have been added." | |||
) |
STATISTIC | ( | NumVFDeclAdded | , |
"Number of function declarations that have been added." | |||
) |