LLVM API Documentation
#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"
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 |
#define DEBUG_TYPE "memdep" |
Definition at line 17 of file MemoryDependenceAnalysis.cpp.
|
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 |
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 117 of file MemoryDependenceAnalysis.cpp.
References llvm::AliasAnalysis::getLocation(), llvm::AliasAnalysis::getTargetLibraryInfo(), llvm::Intrinsic::invariant_end, llvm::Intrinsic::invariant_start, llvm::isFreeCall(), LI, llvm::Intrinsic::lifetime_end, llvm::Intrinsic::lifetime_start, llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayWriteToMemory(), llvm::LLVMContext::MD_tbaa, 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 |
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().
|
static |
RemoveFromReverseMap - This is a helper function that removes Val from 'Inst's set in ReverseMap. If the set becomes empty, remove Inst's entry.
Definition at line 100 of file MemoryDependenceAnalysis.cpp.
References llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT >, KeyT, ValueT, KeyInfoT >::empty(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT >, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT >, KeyT, ValueT, KeyInfoT >::erase(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find().
Referenced by llvm::MemoryDependenceAnalysis::getDependency(), llvm::MemoryDependenceAnalysis::getNonLocalCallDependency(), and llvm::MemoryDependenceAnalysis::removeInstruction().
|
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" | |||
) |
Memory Dependence Analysis |
Definition at line 58 of file MemoryDependenceAnalysis.cpp.
|
static |
Definition at line 50 of file MemoryDependenceAnalysis.cpp.
Referenced by llvm::MemoryDependenceAnalysis::getPointerDependencyFrom().
Memory Dependence false |
Definition at line 58 of file MemoryDependenceAnalysis.cpp.
memdep |
Definition at line 58 of file MemoryDependenceAnalysis.cpp.