LLVM  3.7.0
Namespaces | Macros | Functions | Variables
LoopAccessAnalysis.cpp File Reference
#include "llvm/Analysis/LoopAccessAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Analysis/VectorUtils.h"
Include dependency graph for LoopAccessAnalysis.cpp:

Go to the source code of this file.

Namespaces

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define DEBUG_TYPE   "loop-accesses"
 
#define LAA_NAME   "loop-accesses"
 

Functions

static const SCEVgetMinFromExprs (const SCEV *I, const SCEV *J, ScalarEvolution *SE)
 Compare I and J and return the minimum. More...
 
static bool hasComputableBounds (ScalarEvolution *SE, const ValueToValueMap &Strides, Value *Ptr)
 Check whether a pointer can participate in a runtime bounds check. More...
 
static bool isInBoundsGep (Value *Ptr)
 
static bool isNoWrapAddRec (Value *Ptr, const SCEVAddRecExpr *AR, ScalarEvolution *SE, const Loop *L)
 Return true if an AddRec pointer Ptr is unsigned non-wrapping, i.e. More...
 
static bool areStridedAccessesIndependent (unsigned Distance, unsigned Stride, unsigned TypeByteSize)
 Check the dependence for two accesses with the same stride Stride. More...
 
static InstructiongetFirstInst (Instruction *FirstInst, Value *V, Instruction *Loc)
 
Passllvm::createLAAPass ()
 

Variables

static cl::opt< unsigned, trueVectorizationFactor ("force-vector-width", cl::Hidden, cl::desc("Sets the SIMD width. Zero is autoselect."), cl::location(VectorizerParams::VectorizationFactor))
 
static cl::opt< unsigned, trueVectorizationInterleave ("force-vector-interleave", cl::Hidden, cl::desc("Sets the vectorization interleave count. ""Zero is autoselect."), cl::location(VectorizerParams::VectorizationInterleave))
 
static cl::opt< unsigned, trueRuntimeMemoryCheckThreshold ("runtime-memory-check-threshold", cl::Hidden, cl::desc("When performing memory disambiguation checks at runtime do not ""generate more than this number of comparisons (default = 8)."), cl::location(VectorizerParams::RuntimeMemoryCheckThreshold), cl::init(8))
 
static cl::opt< unsignedMemoryCheckMergeThreshold ("memory-check-merge-threshold", cl::Hidden, cl::desc("Maximum number of comparisons done when trying to merge ""runtime memory checks. (default = 100)"), cl::init(100))
 The maximum iterations used to merge memory checks. More...
 
static cl::opt< unsignedMaxInterestingDependence ("max-interesting-dependences", cl::Hidden, cl::desc("Maximum number of interesting dependences collected by ""loop-access analysis (default = 100)"), cl::init(100))
 We collect interesting dependences up to this threshold. More...
 
static const char laa_name [] = "Loop Access Analysis"
 

Macro Definition Documentation

#define DEBUG_TYPE   "loop-accesses"

Definition at line 28 of file LoopAccessAnalysis.cpp.

#define LAA_NAME   "loop-accesses"

Definition at line 1761 of file LoopAccessAnalysis.cpp.

Function Documentation

static bool areStridedAccessesIndependent ( unsigned  Distance,
unsigned  Stride,
unsigned  TypeByteSize 
)
static

Check the dependence for two accesses with the same stride Stride.

Distance is the positive distance and TypeByteSize is type size in bytes.

Returns
true if they are independent.

Definition at line 951 of file LoopAccessAnalysis.cpp.

static Instruction* getFirstInst ( Instruction FirstInst,
Value V,
Instruction Loc 
)
static
static const SCEV* getMinFromExprs ( const SCEV I,
const SCEV J,
ScalarEvolution SE 
)
static

Compare I and J and return the minimum.

Return nullptr in case we couldn't find an answer.

Definition at line 147 of file LoopAccessAnalysis.cpp.

References llvm::dyn_cast(), llvm::ScalarEvolution::getMinusSCEV(), llvm::SCEVConstant::getValue(), I, and llvm::ConstantInt::isNegative().

Referenced by llvm::RuntimePointerChecking::CheckingPtrGroup::addPointer().

static bool hasComputableBounds ( ScalarEvolution SE,
const ValueToValueMap Strides,
Value Ptr 
)
static

Check whether a pointer can participate in a runtime bounds check.

Definition at line 485 of file LoopAccessAnalysis.cpp.

References llvm::dyn_cast(), llvm::SCEVAddRecExpr::isAffine(), and llvm::replaceSymbolicStrideSCEV().

static bool isInBoundsGep ( Value Ptr)
static

Definition at line 723 of file LoopAccessAnalysis.cpp.

References GEP.

Referenced by llvm::isStridedPtr().

static bool isNoWrapAddRec ( Value Ptr,
const SCEVAddRecExpr AR,
ScalarEvolution SE,
const Loop L 
)
static

Return true if an AddRec pointer Ptr is unsigned non-wrapping, i.e.

monotonically increasing/decreasing.

Definition at line 731 of file LoopAccessAnalysis.cpp.

References llvm::dyn_cast(), llvm::SCEV::FlagNSW, GEP, llvm::SCEVNAryExpr::getNoWrapFlags(), llvm::ScalarEvolution::getSCEV(), and llvm::SCEV::NoWrapMask.

Referenced by llvm::isStridedPtr().

Variable Documentation

const char laa_name[] = "Loop Access Analysis"
static

Definition at line 1760 of file LoopAccessAnalysis.cpp.

cl::opt<unsigned> MaxInterestingDependence("max-interesting-dependences", cl::Hidden, cl::desc("Maximum number of interesting dependences collected by ""loop-access analysis (default = 100)"), cl::init(100))
static

We collect interesting dependences up to this threshold.

Referenced by llvm::MemoryDepChecker::areDepsSafe().

cl::opt<unsigned> MemoryCheckMergeThreshold("memory-check-merge-threshold", cl::Hidden, cl::desc("Maximum number of comparisons done when trying to merge ""runtime memory checks. (default = 100)"), cl::init(100))
static

The maximum iterations used to merge memory checks.

Referenced by llvm::RuntimePointerChecking::groupChecks().

cl::opt<unsigned, true> RuntimeMemoryCheckThreshold("runtime-memory-check-threshold", cl::Hidden, cl::desc("When performing memory disambiguation checks at runtime do not ""generate more than this number of comparisons (default = 8)."), cl::location(VectorizerParams::RuntimeMemoryCheckThreshold), cl::init(8))
static
cl::opt<unsigned, true> VectorizationFactor("force-vector-width", cl::Hidden, cl::desc("Sets the SIMD width. Zero is autoselect."), cl::location(VectorizerParams::VectorizationFactor))
static
cl::opt<unsigned, true> VectorizationInterleave("force-vector-interleave", cl::Hidden, cl::desc("Sets the vectorization interleave count. ""Zero is autoselect."), cl::location(VectorizerParams::VectorizationInterleave))
static