LLVM API Documentation
#include "llvm/Transforms/Vectorize.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/MapVector.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/SmallSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/StringExtras.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Analysis/AliasSetTracker.h"#include "llvm/Analysis/Dominators.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/Analysis/LoopIterator.h"#include "llvm/Analysis/LoopPass.h"#include "llvm/Analysis/ScalarEvolution.h"#include "llvm/Analysis/ScalarEvolutionExpander.h"#include "llvm/Analysis/ScalarEvolutionExpressions.h"#include "llvm/Analysis/TargetTransformInfo.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/Analysis/Verifier.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Function.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/Module.h"#include "llvm/IR/Type.h"#include "llvm/IR/Value.h"#include "llvm/Pass.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/PatternMatch.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Support/ValueHandle.h"#include "llvm/Target/TargetLibraryInfo.h"#include "llvm/Transforms/Scalar.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"#include "llvm/Transforms/Utils/Local.h"#include <algorithm>#include <map>
Go to the source code of this file.
Namespaces | |
| namespace | llvm |
List of target independent CodeGen pass IDs. | |
Defines | |
| #define | LV_NAME "loop-vectorize" |
| #define | DEBUG_TYPE LV_NAME |
Functions | |
| static Intrinsic::ID | getIntrinsicIDForCall (CallInst *CI, const TargetLibraryInfo *TLI) |
| static unsigned | getReductionBinOp (LoopVectorizationLegality::ReductionKind Kind) |
| This function translates the reduction kind to an LLVM binary operator. | |
| Value * | createMinMaxOp (IRBuilder<> &Builder, LoopVectorizationLegality::MinMaxReductionKind RK, Value *Left, Value *Right) |
| static Type * | convertPointerToIntegerType (DataLayout &DL, Type *Ty) |
| static Type * | getWiderType (DataLayout &DL, Type *Ty0, Type *Ty1) |
| static bool | hasMultipleUsesOf (Instruction *I, SmallPtrSet< Instruction *, 8 > &Insts) |
| static bool | areAllUsesIn (Instruction *I, SmallPtrSet< Instruction *, 8 > &Set) |
| Pass * | llvm::createLoopVectorizePass () |
Variables | |
| static cl::opt< unsigned > | VectorizationFactor ("force-vector-width", cl::init(0), cl::Hidden, cl::desc("Sets the SIMD width. Zero is autoselect.")) |
| static cl::opt< unsigned > | VectorizationUnroll ("force-vector-unroll", cl::init(0), cl::Hidden, cl::desc("Sets the vectorization unroll count. ""Zero is autoselect.")) |
| static cl::opt< bool > | EnableIfConversion ("enable-if-conversion", cl::init(true), cl::Hidden, cl::desc("Enable if-conversion during vectorization.")) |
| static cl::opt< unsigned > | TinyTripCountVectorThreshold ("vectorizer-min-trip-count", cl::init(16), cl::Hidden, cl::desc("Don't vectorize loops with a constant ""trip count that is smaller than this ""value.")) |
| We don't vectorize loops with a known constant trip count below this number. | |
| static const unsigned | TinyTripCountUnrollThreshold = 128 |
| We don't unroll loops with a known constant trip count below this number. | |
| static const unsigned | RuntimeMemoryCheckThreshold = 8 |
| static const char * | AlreadyVectorizedMDName = "llvm.vectorizer.already_vectorized" |
| static const char | lv_name [] = "Loop Vectorization" |
| #define DEBUG_TYPE LV_NAME |
Definition at line 46 of file LoopVectorize.cpp.
| #define LV_NAME "loop-vectorize" |
Definition at line 45 of file LoopVectorize.cpp.
| static bool areAllUsesIn | ( | Instruction * | I, |
| SmallPtrSet< Instruction *, 8 > & | Set | ||
| ) | [static] |
Definition at line 3030 of file LoopVectorize.cpp.
References llvm::SmallPtrSet< PtrType, SmallSize >::count(), llvm::User::op_begin(), and llvm::User::op_end().
| static Type* convertPointerToIntegerType | ( | DataLayout & | DL, |
| Type * | Ty | ||
| ) | [static] |
Definition at line 2501 of file LoopVectorize.cpp.
References llvm::Type::getContext(), llvm::DataLayout::getIntPtrType(), and llvm::Type::isPointerTy().
Referenced by getWiderType().
| Value* createMinMaxOp | ( | IRBuilder<> & | Builder, |
| LoopVectorizationLegality::MinMaxReductionKind | RK, | ||
| Value * | Left, | ||
| Value * | Right | ||
| ) |
Definition at line 1774 of file LoopVectorize.cpp.
References llvm::IRBuilder< preserveNames, T, Inserter >::CreateFCmp(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateICmp(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateSelect(), llvm::CmpInst::FCMP_OGT, llvm::CmpInst::FCMP_OLT, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULT, llvm_unreachable, P, and llvm::Select.
| static Intrinsic::ID getIntrinsicIDForCall | ( | CallInst * | CI, |
| const TargetLibraryInfo * | TLI | ||
| ) | [static] |
Definition at line 1644 of file LoopVectorize.cpp.
References llvm::LibFunc::ceil, llvm::LibFunc::ceilf, llvm::LibFunc::ceill, llvm::LibFunc::cos, llvm::LibFunc::cosf, llvm::LibFunc::cosl, llvm::LibFunc::exp, llvm::LibFunc::exp2, llvm::LibFunc::exp2f, llvm::LibFunc::exp2l, llvm::LibFunc::expf, llvm::LibFunc::expl, F(), llvm::LibFunc::fabs, llvm::LibFunc::fabsf, llvm::LibFunc::fabsl, llvm::LibFunc::floor, llvm::LibFunc::floorf, llvm::LibFunc::floorl, llvm::CallInst::getCalledFunction(), llvm::TargetLibraryInfo::getLibFunc(), llvm::Value::getName(), llvm::LibFunc::log, llvm::LibFunc::log10, llvm::LibFunc::log10f, llvm::LibFunc::log10l, llvm::LibFunc::log2, llvm::LibFunc::log2f, llvm::LibFunc::log2l, llvm::LibFunc::logf, llvm::LibFunc::logl, llvm::LibFunc::nearbyint, llvm::LibFunc::nearbyintf, llvm::LibFunc::nearbyintl, llvm::Intrinsic::not_intrinsic, llvm::LibFunc::pow, llvm::LibFunc::powf, llvm::LibFunc::powl, llvm::LibFunc::rint, llvm::LibFunc::rintf, llvm::LibFunc::rintl, llvm::LibFunc::sin, llvm::LibFunc::sinf, llvm::LibFunc::sinl, llvm::LibFunc::sqrt, llvm::LibFunc::trunc, llvm::LibFunc::truncf, and llvm::LibFunc::truncl.
| static unsigned getReductionBinOp | ( | LoopVectorizationLegality::ReductionKind | Kind | ) | [static] |
This function translates the reduction kind to an LLVM binary operator.
Definition at line 1749 of file LoopVectorize.cpp.
References llvm::APIntOps::And(), llvm::ICmp, llvm_unreachable, llvm::APIntOps::Or(), and llvm::APIntOps::Xor().
| static Type* getWiderType | ( | DataLayout & | DL, |
| Type * | Ty0, | ||
| Type * | Ty1 | ||
| ) | [static] |
Definition at line 2507 of file LoopVectorize.cpp.
References convertPointerToIntegerType(), and llvm::Type::getScalarSizeInBits().
| static bool hasMultipleUsesOf | ( | Instruction * | I, |
| SmallPtrSet< Instruction *, 8 > & | Insts | ||
| ) | [static] |
Definition at line 3017 of file LoopVectorize.cpp.
References llvm::SmallPtrSet< PtrType, SmallSize >::count(), llvm::User::op_begin(), and llvm::User::op_end().
const char* AlreadyVectorizedMDName = "llvm.vectorizer.already_vectorized" [static] |
We use a metadata with this name to indicate that a scalar loop was vectorized and that we don't need to re-vectorize it if we run into it again.
Definition at line 126 of file LoopVectorize.cpp.
cl::opt<bool> EnableIfConversion("enable-if-conversion", cl::init(true), cl::Hidden, cl::desc("Enable if-conversion during vectorization.")) [static] |
const char lv_name[] = "Loop Vectorization" [static] |
Definition at line 3919 of file LoopVectorize.cpp.
const unsigned RuntimeMemoryCheckThreshold = 8 [static] |
When performing memory disambiguation checks at runtime do not make more than this number of comparisons.
Definition at line 120 of file LoopVectorize.cpp.
const unsigned TinyTripCountUnrollThreshold = 128 [static] |
We don't unroll loops with a known constant trip count below this number.
Definition at line 116 of file LoopVectorize.cpp.
cl::opt<unsigned> TinyTripCountVectorThreshold("vectorizer-min-trip-count", cl::init(16), cl::Hidden, cl::desc("Don't vectorize loops with a constant ""trip count that is smaller than this ""value.")) [static] |
We don't vectorize loops with a known constant trip count below this number.
cl::opt<unsigned> VectorizationFactor("force-vector-width", cl::init(0), cl::Hidden, cl::desc("Sets the SIMD width. Zero is autoselect.")) [static] |
cl::opt<unsigned> VectorizationUnroll("force-vector-unroll", cl::init(0), cl::Hidden, cl::desc("Sets the vectorization unroll count. ""Zero is autoselect.")) [static] |