|
LLVM
4.0.0
|
#include "llvm/Analysis/MemoryDependenceAnalysis.h"#include "llvm/ADT/SmallSet.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Analysis/AssumptionCache.h"#include "llvm/Analysis/MemoryBuiltins.h"#include "llvm/Analysis/PHITransAddr.h"#include "llvm/Analysis/OrderedBasicBlock.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/Analysis/TargetLibraryInfo.h"#include "llvm/IR/CallSite.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Function.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/PredIteratorCache.h"#include "llvm/Support/AtomicOrdering.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Debug.h"#include "llvm/Support/MathExtras.h"#include <algorithm>#include <cassert>#include <iterator>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<typename KeyTy > | |
| 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. More... | |
| 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. More... | |
| static bool | isVolatile (Instruction *Inst) |
| 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. More... | |
| 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. More... | |
| 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(1000), cl::desc("The number of blocks to scan during memory ""dependency analysis (default = 1000)")) |
| static const unsigned int | NumResultsLimit = 100 |
| memdep | |
| Memory Dependence | Analysis |
| Memory Dependence | false |
| #define DEBUG_TYPE "memdep" |
Definition at line 52 of file MemoryDependenceAnalysis.cpp.
|
static |
This method is used when -debug is specified to verify that cache arrays are properly kept sorted.
Definition at line 767 of file MemoryDependenceAnalysis.cpp.
References assert().
Referenced by llvm::MemoryDependenceResults::getNonLocalCallDependency().
|
static |
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 103 of file MemoryDependenceAnalysis.cpp.
References llvm::MemoryLocation::get(), llvm::isFreeCall(), llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayWriteToMemory(), llvm::Monotonic, llvm::MRI_Mod, llvm::MRI_ModRef, llvm::MRI_NoModRef, llvm::MRI_Ref, and SI.
Referenced by llvm::MemoryDependenceResults::getDependency().
| INITIALIZE_PASS_BEGIN | ( | MemoryDependenceWrapperPass | , |
| "memdep" | , | ||
| "Memory Dependence Analysis" | , | ||
| false | , | ||
| true | |||
| ) |
|
static |
Definition at line 312 of file MemoryDependenceAnalysis.cpp.
References SI.
Referenced by llvm::FunctionComparator::cmpOperations(), combineStore(), llvm::IRBuilder< TargetFolder >::CreateAlignedStore(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), llvm::IRBuilder< TargetFolder >::CreateStore(), determinePointerReadAttrs(), llvm::X86SelectionDAGInfo::EmitTargetCodeForMemcpy(), llvm::X86SelectionDAGInfo::EmitTargetCodeForMemset(), llvm::MemoryDependenceResults::getNonLocalPointerDependency(), llvm::MemoryDependenceResults::getSimplePointerDependencyFrom(), hasNormalLoadOperand(), haveSameSpecialState(), isRemovable(), LLVMGetVolatile(), lowerVectorShuffleAsBroadcast(), PerformInsertEltCombine(), performIntToFpCombine(), PerformVMOVRRDCombine(), llvm::PointerMayBeCaptured(), and llvm::InstCombiner::visitFCmpInst().
|
static |
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 86 of file MemoryDependenceAnalysis.cpp.
References assert(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::empty(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::erase(), and llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find().
Referenced by llvm::MemoryDependenceResults::getDependency(), llvm::MemoryDependenceResults::getNonLocalCallDependency(), and llvm::MemoryDependenceResults::removeInstruction().
|
static |
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 1040 of file MemoryDependenceAnalysis.cpp.
References LLVM_FALLTHROUGH.
| 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 1721 of file MemoryDependenceAnalysis.cpp.
|
static |
| Memory Dependence false |
Definition at line 1721 of file MemoryDependenceAnalysis.cpp.
| memdep |
Definition at line 1721 of file MemoryDependenceAnalysis.cpp.
Definition at line 79 of file MemoryDependenceAnalysis.cpp.
1.8.6