LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions | Variables
MemoryDependenceAnalysis.cpp File Reference
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/MemoryBuiltins.h"
#include "llvm/Analysis/PHITransAddr.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/PredIteratorCache.h"
Include dependency graph for MemoryDependenceAnalysis.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "memdep"
 

Functions

 STATISTIC (NumCacheNonLocal,"Number of fully cached non-local responses")
 
 STATISTIC (NumCacheDirtyNonLocal,"Number of dirty cached non-local responses")
 
 STATISTIC (NumUncacheNonLocal,"Number of uncached non-local responses")
 
 STATISTIC (NumCacheNonLocalPtr,"Number of fully cached non-local ptr responses")
 
 STATISTIC (NumCacheDirtyNonLocalPtr,"Number of cached, but dirty, non-local ptr responses")
 
 STATISTIC (NumUncacheNonLocalPtr,"Number of uncached non-local ptr responses")
 
 STATISTIC (NumCacheCompleteNonLocalPtr,"Number of block queries that were completely cached")
 
 INITIALIZE_PASS_BEGIN (MemoryDependenceAnalysis,"memdep","Memory Dependence Analysis", false, true) INITIALIZE_PASS_END(MemoryDependenceAnalysis
 
template<typename KeyTy >
static void RemoveFromReverseMap (DenseMap< Instruction *, SmallPtrSet< KeyTy, 4 > > &ReverseMap, Instruction *Inst, KeyTy Val)
 
static AliasAnalysis::ModRefResult GetLocation (const Instruction *Inst, AliasAnalysis::Location &Loc, AliasAnalysis *AA)
 
static bool isLoadLoadClobberIfExtendedToFullWidth (const AliasAnalysis::Location &MemLoc, const Value *&MemLocBase, int64_t &MemLocOffs, const LoadInst *LI, const DataLayout *TD)
 
static void AssertSorted (MemoryDependenceAnalysis::NonLocalDepInfo &Cache, int Count=-1)
 
static void SortNonLocalDepInfoCache (MemoryDependenceAnalysis::NonLocalDepInfo &Cache, unsigned NumSortedEntries)
 

Variables

static const int BlockScanLimit = 100
 
 memdep
 
Memory Dependence Analysis
 
Memory Dependence false
 

Macro Definition Documentation

#define DEBUG_TYPE   "memdep"

Definition at line 17 of file MemoryDependenceAnalysis.cpp.

Function Documentation

static void AssertSorted ( MemoryDependenceAnalysis::NonLocalDepInfo Cache,
int  Count = -1 
)
static

AssertSorted - This method is used when -debug is specified to verify that cache arrays are properly kept sorted.

Definition at line 606 of file MemoryDependenceAnalysis.cpp.

Referenced by llvm::MemoryDependenceAnalysis::getNonLocalCallDependency().

static AliasAnalysis::ModRefResult GetLocation ( const Instruction Inst,
AliasAnalysis::Location Loc,
AliasAnalysis AA 
)
static
INITIALIZE_PASS_BEGIN ( MemoryDependenceAnalysis  ,
"memdep"  ,
"Memory Dependence Analysis ,
false  ,
true   
)
static bool isLoadLoadClobberIfExtendedToFullWidth ( const AliasAnalysis::Location MemLoc,
const Value *&  MemLocBase,
int64_t &  MemLocOffs,
const LoadInst LI,
const DataLayout TD 
)
static

isLoadLoadClobberIfExtendedToFullWidth - Return true if LI is a load that would fully overlap MemLoc if done as a wider legal integer load.

MemLocBase, MemLocOffset are lazily computed here the first time the base/offs of memloc is needed.

Definition at line 255 of file MemoryDependenceAnalysis.cpp.

References llvm::MemoryDependenceAnalysis::getLoadLoadClobberFullWidthSize(), llvm::GetPointerBaseWithConstantOffset(), llvm::AliasAnalysis::Location::Ptr, and llvm::AliasAnalysis::Location::Size.

Referenced by llvm::MemoryDependenceAnalysis::getPointerDependencyFrom().

template<typename KeyTy >
static void RemoveFromReverseMap ( DenseMap< Instruction *, SmallPtrSet< KeyTy, 4 > > &  ReverseMap,
Instruction Inst,
KeyTy  Val 
)
static
static void SortNonLocalDepInfoCache ( MemoryDependenceAnalysis::NonLocalDepInfo Cache,
unsigned  NumSortedEntries 
)
static

SortNonLocalDepInfoCache - Sort the a NonLocalDepInfo cache, given a certain number of elements in the array that are already properly ordered. This is optimized for the case when only a few entries are added.

Definition at line 864 of file MemoryDependenceAnalysis.cpp.

STATISTIC ( NumCacheNonLocal  ,
"Number of fully cached non-local responses"   
)
STATISTIC ( NumCacheDirtyNonLocal  ,
"Number of dirty cached non-local responses"   
)
STATISTIC ( NumUncacheNonLocal  ,
"Number of uncached non-local responses"   
)
STATISTIC ( NumCacheNonLocalPtr  ,
"Number of fully cached non-local ptr responses"   
)
STATISTIC ( NumCacheDirtyNonLocalPtr  ,
"Number of  cached,
but  dirty,
non-local ptr responses"   
)
STATISTIC ( NumUncacheNonLocalPtr  ,
"Number of uncached non-local ptr responses"   
)
STATISTIC ( NumCacheCompleteNonLocalPtr  ,
"Number of block queries that were completely cached"   
)

Variable Documentation

Memory Dependence Analysis

Definition at line 58 of file MemoryDependenceAnalysis.cpp.

const int BlockScanLimit = 100
static

Definition at line 58 of file MemoryDependenceAnalysis.cpp.

memdep

Definition at line 58 of file MemoryDependenceAnalysis.cpp.