LLVM API Documentation

Defines | 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/AssumptionTracker.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/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/PredIteratorCache.h"
#include "llvm/Support/Debug.h"
Include dependency graph for MemoryDependenceAnalysis.cpp:

Go to the source code of this file.

Defines

#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 *DL)
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

Define Documentation

#define DEBUG_TYPE   "memdep"

Definition at line 36 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 698 of file MemoryDependenceAnalysis.cpp.

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

GetLocation - If the given instruction references a specific memory location, fill in Loc with the details, otherwise set Loc.Ptr to null. Return a ModRefInfo value describing the general behavior of the instruction.

Definition at line 125 of file MemoryDependenceAnalysis.cpp.

References llvm::AliasAnalysis::getLocation(), llvm::AliasAnalysis::getTargetLibraryInfo(), llvm::isFreeCall(), LI, llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayWriteToMemory(), llvm::AliasAnalysis::Mod, llvm::AliasAnalysis::ModRef, llvm::Monotonic, llvm::AliasAnalysis::NoModRef, and llvm::AliasAnalysis::Ref.

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

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 DL 
) [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 266 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 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 956 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

Definition at line 61 of file MemoryDependenceAnalysis.cpp.

const int BlockScanLimit = 100 [static]

Definition at line 61 of file MemoryDependenceAnalysis.cpp.

Definition at line 61 of file MemoryDependenceAnalysis.cpp.