LLVM: lib/Analysis/MemoryDependenceAnalysis.cpp File Reference (original) (raw)

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")
template
static void RemoveFromReverseMap (DenseMap< Instruction *, SmallPtrSet< KeyTy, 4 > > &ReverseMap, Instruction *Inst, KeyTy Val)
This is a helper function that removes Val from 'Inst's set in ReverseMap.
static ModRefInfo GetLocation (const Instruction *Inst, MemoryLocation &Loc, const TargetLibraryInfo &TLI)
If the given instruction references a specific memory location, fill in Loc with the details, otherwise set Loc.Ptr to null.
static bool canSkipClobberingStore (const StoreInst *SI, const MemoryLocation &MemLoc, Align MemLocAlign, BatchAAResults &BatchAA, unsigned ScanLimit)
static void AssertSorted (MemoryDependenceResults::NonLocalDepInfo &Cache, int Count=-1)
This method is used when -debug is specified to verify that cache arrays are properly kept sorted.
static void SortNonLocalDepInfoCache (MemoryDependenceResults::NonLocalDepInfo &Cache, unsigned NumSortedEntries)
Sort the NonLocalDepInfo cache, given a certain number of elements in the array that are already properly ordered.
INITIALIZE_PASS_BEGIN (MemoryDependenceWrapperPass, "memdep", "Memory Dependence Analysis", false, true) INITIALIZE_PASS_END(MemoryDependenceWrapperPass
Variables
static cl::opt< unsigned > BlockScanLimit ("memdep-block-scan-limit", cl::Hidden, cl::init(100), cl::desc("The number of instructions to scan in a block in memory " "dependency analysis (default = 100)"))
static cl::opt< unsigned > BlockNumberLimit ("memdep-block-number-limit", cl::Hidden, cl::init(200), cl::desc("The number of blocks to scan during memory " "dependency analysis (default = 200)"))
static cl::opt< unsigned > CacheGlobalLimit ("memdep-cache-global-limit", cl::Hidden, cl::init(10000), cl::desc("The max number of entries allowed in a cache (default = 10000)"))
static const unsigned int NumResultsLimit = 100
memdep
Memory Dependence Analysis
Memory Dependence false

DEBUG_TYPE

#define DEBUG_TYPE "memdep"

AssertSorted()

canSkipClobberingStore()

Definition at line 344 of file MemoryDependenceAnalysis.cpp.

References llvm::BatchAAResults::alias(), llvm::dyn_cast(), llvm::MemoryLocation::get(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(), llvm::BatchAAResults::getModRefInfo(), llvm::LocationSize::getValue(), llvm::LocationSize::hasValue(), I, llvm::isModSet(), llvm::LocationSize::isScalable(), llvm::AliasResult::MustAlias, Size, and llvm::MemoryLocation::Size.

Referenced by llvm::MemoryDependenceResults::getSimplePointerDependencyFrom().

GetLocation()

If the given instruction references a specific memory location, fill in Loc with the details, otherwise set Loc.Ptr to null.

Returns a ModRefInfo value describing the general behavior of the instruction.

Definition at line 112 of file MemoryDependenceAnalysis.cpp.

References llvm::dyn_cast(), llvm::MemoryLocation::get(), llvm::MemoryLocation::getAfter(), llvm::MemoryLocation::getForArgument(), llvm::getFreedOperand(), II, llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayWriteToMemory(), llvm::Mod, llvm::ModRef, llvm::Monotonic, llvm::NoModRef, and llvm::Ref.

Referenced by llvm::MemoryDependenceResults::getDependency(), and llvm::MemoryDependenceResults::getSimplePointerDependencyFrom().

INITIALIZE_PASS_BEGIN()

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 95 of file MemoryDependenceAnalysis.cpp.

References assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase().

Referenced by llvm::MemoryDependenceResults::getDependency(), llvm::MemoryDependenceResults::getNonLocalCallDependency(), and llvm::MemoryDependenceResults::removeInstruction().

SortNonLocalDepInfoCache()

STATISTIC() [1/7]

STATISTIC ( NumCacheCompleteNonLocalPtr ,
"Number of block queries that were completely cached" )

STATISTIC() [2/7]

STATISTIC ( NumCacheDirtyNonLocal ,
"Number of dirty cached non-local responses" )

STATISTIC() [3/7]

STATISTIC ( NumCacheDirtyNonLocalPtr ,
"Number of cached,
but dirty,
non-local ptr responses" )

STATISTIC() [4/7]

STATISTIC ( NumCacheNonLocal ,
"Number of fully cached non-local responses" )

STATISTIC() [5/7]

STATISTIC ( NumCacheNonLocalPtr ,
"Number of fully cached non-local ptr responses" )

STATISTIC() [6/7]

STATISTIC ( NumUncacheNonLocal ,
"Number of uncached non-local responses" )

STATISTIC() [7/7]

STATISTIC ( NumUncacheNonLocalPtr ,
"Number of uncached non-local ptr responses" )

BlockNumberLimit

BlockScanLimit

CacheGlobalLimit

cl::opt< unsigned > CacheGlobalLimit("memdep-cache-global-limit", cl::Hidden, cl::init(10000), cl::desc("The max number of entries allowed in a cache (default = 10000)")) ( "memdep-cache-global-limit" , cl::Hidden , cl::init(10000) , cl::desc("The max number of entries allowed in a cache (default = 10000)") ) static

false

memdep

NumResultsLimit