LLVM API Documentation

Namespaces | Defines | Functions | Variables
LoopVectorize.cpp File Reference
#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>
Include dependency graph for LoopVectorize.cpp:

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.
ValuecreateMinMaxOp (IRBuilder<> &Builder, LoopVectorizationLegality::MinMaxReductionKind RK, Value *Left, Value *Right)
static TypeconvertPointerToIntegerType (DataLayout &DL, Type *Ty)
static TypegetWiderType (DataLayout &DL, Type *Ty0, Type *Ty1)
static bool hasMultipleUsesOf (Instruction *I, SmallPtrSet< Instruction *, 8 > &Insts)
static bool areAllUsesIn (Instruction *I, SmallPtrSet< Instruction *, 8 > &Set)
Passllvm::createLoopVectorizePass ()

Variables

static cl::opt< unsignedVectorizationFactor ("force-vector-width", cl::init(0), cl::Hidden, cl::desc("Sets the SIMD width. Zero is autoselect."))
static cl::opt< unsignedVectorizationUnroll ("force-vector-unroll", cl::init(0), cl::Hidden, cl::desc("Sets the vectorization unroll count. ""Zero is autoselect."))
static cl::opt< boolEnableIfConversion ("enable-if-conversion", cl::init(true), cl::Hidden, cl::desc("Enable if-conversion during vectorization."))
static cl::opt< unsignedTinyTripCountVectorThreshold ("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 Documentation

#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.


Function Documentation

static bool areAllUsesIn ( Instruction I,
SmallPtrSet< Instruction *, 8 > &  Set 
) [static]
static Type* convertPointerToIntegerType ( DataLayout DL,
Type Ty 
) [static]
Value* createMinMaxOp ( IRBuilder<> &  Builder,
LoopVectorizationLegality::MinMaxReductionKind  RK,
Value Left,
Value Right 
)
static Intrinsic::ID getIntrinsicIDForCall ( CallInst CI,
const TargetLibraryInfo TLI 
) [static]
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]
static bool hasMultipleUsesOf ( Instruction I,
SmallPtrSet< Instruction *, 8 > &  Insts 
) [static]

Variable Documentation

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.

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]