|
LLVM
10.0.0
|
#include "llvm/Transforms/Utils/InjectTLIMappings.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/VectorUtils.h"#include "llvm/IR/InstIterator.h"#include "llvm/Transforms/Utils.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 std::string | mangleTLIName (StringRef VectorName, const CallInst &CI, unsigned VF) |
| Helper function to map the TLI name to a strings that holds scalar-to-vector mapping. More... | |
| static Type * | ToVectorTy (Type *Scalar, unsigned VF, bool isScalable=false) |
| A helper function for converting Scalar types to vector types. More... | |
| static void | addVariantDeclaration (CallInst &CI, const unsigned VF, const StringRef VFName) |
| A helper function that adds the vector function declaration that vectorizes the CallInst CI with a vectorization factor of VF lanes. More... | |
| static void | addMappingsFromTLI (const TargetLibraryInfo &TLI, CallInst &CI) |
| static bool | runImpl (const TargetLibraryInfo &TLI, Function &F) |
| INITIALIZE_PASS_BEGIN (InjectTLIMappingsLegacy, DEBUG_TYPE, "Inject TLI Mappings", false, false) INITIALIZE_PASS_END(InjectTLIMappingsLegacy | |
Variables | |
| DEBUG_TYPE | |
| Inject TLI | Mappings |
| Inject TLI | false |
| #define DEBUG_TYPE "inject-tli-mappings" |
Definition at line 23 of file InjectTLIMappings.cpp.
Referenced by addVariantDeclaration(), and llvm::InjectTLIMappingsLegacy::getAnalysisUsage().
|
static |
Definition at line 101 of file InjectTLIMappings.cpp.
References addVariantDeclaration(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::CallBase::getCalledFunction(), llvm::Module::getFunction(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::TargetLibraryInfo::getVectorizedFunction(), llvm::VFABI::getVectorVariantNames(), llvm::TargetLibraryInfo::getWidestVF(), llvm::TargetLibraryInfo::isFunctionVectorizable(), llvm::CallBase::isNoBuiltin(), mangleTLIName(), Mappings, 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 72 of file InjectTLIMappings.cpp.
References llvm::appendToCompilerUsed(), llvm::CallBase::arg_operands(), assert(), llvm::Function::copyAttributesFrom(), llvm::Function::Create(), llvm::dbgs(), DEBUG_TYPE, llvm::GlobalValue::ExternalLinkage, llvm::FunctionType::get(), llvm::CallBase::getCalledFunction(), llvm::CallBase::getFunctionType(), llvm::Instruction::getModule(), llvm::Value::getType(), llvm::GlobalValue::getType(), llvm::FunctionType::isVarArg(), LLVM_DEBUG, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Function::size(), and ToVectorTy().
Referenced by addMappingsFromTLI().
| INITIALIZE_PASS_BEGIN | ( | InjectTLIMappingsLegacy | , |
| DEBUG_TYPE | , | ||
| "Inject TLI Mappings" | , | ||
| false | , | ||
| false | |||
| ) |
Referenced by llvm::InjectTLIMappingsLegacy::getAnalysisUsage().
Helper function to map the TLI name to a strings that holds scalar-to-vector mapping.
ZGV<isa><mask><vlen><vparams><scalarname>(<vectorname>)
where:
<isa> = "_LLVM_" <mask> = "N". Note: TLI does not support masked interfaces. <vlen> = Number of concurrent lanes, stored in the VectorizationFactor field of the VecDesc struct. <vparams> = "v", as many as are the number of parameters of CI. <scalarname> = the name of the scalar function called by CI. <vectorname> = the name of the vector function mapped by the TLI.
Definition at line 47 of file InjectTLIMappings.cpp.
References llvm::VFABI::_LLVM_, llvm::CallBase::getCalledFunction(), llvm::Value::getName(), llvm::CallBase::getNumArgOperands(), I, and llvm::raw_svector_ostream::str().
Referenced by addMappingsFromTLI().
|
static |
Definition at line 139 of file InjectTLIMappings.cpp.
References addMappingsFromTLI(), I, and llvm::instructions().
Referenced by llvm::InjectTLIMappings::run(), and llvm::InjectTLIMappingsLegacy::runOnFunction().
| 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." | |||
| ) |
A helper function for converting Scalar types to vector types.
If the incoming type is void, we return void. If the VF is 1, we return the scalar type.
Definition at line 61 of file InjectTLIMappings.cpp.
References llvm::VectorType::get(), and llvm::Type::isVoidTy().
Referenced by addVariantDeclaration().
| DEBUG_TYPE |
Definition at line 181 of file InjectTLIMappings.cpp.
| Inject TLI false |
Definition at line 181 of file InjectTLIMappings.cpp.
| Inject TLI Mappings |
Definition at line 181 of file InjectTLIMappings.cpp.
Referenced by llvm::vfs::YAMLVFSWriter::addFileMapping(), llvm::codeview::DebugCrossModuleExportsSubsection::addMapping(), addMappingsFromTLI(), llvm::codeview::DebugCrossModuleExportsSubsection::calculateSerializedSize(), llvm::codeview::DebugCrossModuleImportsSubsection::calculateSerializedSize(), llvm::codeview::DebugCrossModuleExportsSubsection::classof(), llvm::codeview::DebugCrossModuleExportsSubsection::commit(), llvm::codeview::DebugCrossModuleImportsSubsection::commit(), llvm::vfs::YAMLVFSWriter::getMappings(), and llvm::vfs::YAMLVFSWriter::write().
1.8.13