| 
    LLVM 22.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/TargetLibraryInfo.h"#include "llvm/Analysis/VectorUtils.h"#include "llvm/IR/InstIterator.h"#include "llvm/IR/VFABIDemangler.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 VecDesc *VD) | 
A helper function that adds the vector variant declaration for vectorizing 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 74 of file InjectTLIMappings.cpp.
References addVariantDeclaration(), llvm::SetVector< T, Vector, Set, N >::count(), llvm::StringRef::empty(), llvm::from_range, llvm::CallBase::getCalledFunction(), llvm::ElementCount::getFixed(), llvm::Function::getFunction(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::ElementCount::getScalable(), llvm::VecDesc::getVectorFnName(), llvm::VecDesc::getVectorFunctionABIVariantString(), llvm::TargetLibraryInfo::getVectorMappingInfo(), llvm::VFABI::getVectorVariantNames(), llvm::TargetLibraryInfo::getWidestVF(), llvm::TargetLibraryInfo::isFunctionVectorizable(), llvm::details::FixedOrScalableQuantity< ElementCount, unsigned >::isKnownLE(), llvm::CallBase::isNoBuiltin(), llvm::Predicated, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::VFABI::setVectorVariantNames().
Referenced by runImpl().
      
  | 
  static | 
A helper function that adds the vector variant declaration for vectorizing the CallInst CI with a vectorization factor of VF lanes. 
For each mapping, TLI provides a VABI prefix, which contains all information required to create vector function declaration.
Definition at line 40 of file InjectTLIMappings.cpp.
References llvm::appendToCompilerUsed(), assert(), llvm::Function::copyAttributesFrom(), llvm::Function::Create(), llvm::VFABI::createFunctionType(), llvm::dbgs(), DEBUG_TYPE, llvm::GlobalValue::ExternalLinkage, llvm::CallBase::getCalledFunction(), llvm::VecDesc::getCallingConv(), llvm::CallBase::getFunctionType(), llvm::Instruction::getModule(), llvm::VecDesc::getVectorFnName(), llvm::VecDesc::getVectorFunctionABIVariantString(), Info, LLVM_DEBUG, llvm::Function::setCallingConv(), llvm::Function::size(), and llvm::VFABI::tryDemangleForVFABI().
Referenced by addMappingsFromTLI().
      
  | 
  static | 
Definition at line 125 of file InjectTLIMappings.cpp.
References addMappingsFromTLI(), llvm::dyn_cast(), 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." | ) |