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.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, 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) |
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 27 of file InjectTLIMappings.cpp.
|
static |
Definition at line 71 of file InjectTLIMappings.cpp.
References addVariantDeclaration(), llvm::CallBase::arg_size(), assert(), llvm::SetVector< T, Vector, Set >::count(), llvm::CallBase::getCalledFunction(), llvm::ElementCount::getFixed(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::TargetLibraryInfo::getVectorizedFunction(), llvm::VFABI::getVectorVariantNames(), llvm::TargetLibraryInfo::getWidestVF(), llvm::TargetLibraryInfo::isFunctionVectorizable(), llvm::CallBase::isNoBuiltin(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isZero(), llvm::VFABI::mangleTLIVectorName(), Mappings, 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 42 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::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().
INITIALIZE_PASS_BEGIN | ( | InjectTLIMappingsLegacy | , |
DEBUG_TYPE | , | ||
"Inject TLI Mappings" | , | ||
false | , | ||
false | |||
) |
|
static |
Definition at line 123 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." | |||
) |
DEBUG_TYPE |
Definition at line 171 of file InjectTLIMappings.cpp.
Inject TLI false |
Definition at line 172 of file InjectTLIMappings.cpp.
Inject TLI Mappings |
Definition at line 171 of file InjectTLIMappings.cpp.
Referenced by addMappingsFromTLI(), cloneCandidateFunction(), llvm::OpenMPIRBuilder::createOffloadMaptypes(), llvm::vfs::YAMLVFSWriter::getMappings(), getSameOpcode(), and llvm::vfs::YAMLVFSWriter::write().