diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-05-14 20:35:04 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-05-14 20:35:04 +0000 |
commit | 3a884f5c17ac32e34e7e62b4602a0d73eeda1ce8 (patch) | |
tree | 43d6a1b9b7b981588849d32a247a5e903ea97dad /include | |
parent | 5262abb2682a4d09cda3563a55f27caffb57466c (diff) | |
download | llvm-3a884f5c17ac32e34e7e62b4602a0d73eeda1ce8.tar.gz llvm-3a884f5c17ac32e34e7e62b4602a0d73eeda1ce8.tar.bz2 llvm-3a884f5c17ac32e34e7e62b4602a0d73eeda1ce8.tar.xz |
Move the capture analysis from MemoryDependencyAnalysis to a more general place
so that it can be reused in MemCpyOptimizer. This analysis is needed to remove
an unnecessary memcpy when returning a struct into a local variable.
rdar://11341081
PR12686
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156776 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/AliasAnalysis.h | 13 | ||||
-rw-r--r-- | include/llvm/Analysis/MemoryDependenceAnalysis.h | 3 |
2 files changed, 13 insertions, 3 deletions
diff --git a/include/llvm/Analysis/AliasAnalysis.h b/include/llvm/Analysis/AliasAnalysis.h index b823f71a22..674868a026 100644 --- a/include/llvm/Analysis/AliasAnalysis.h +++ b/include/llvm/Analysis/AliasAnalysis.h @@ -50,6 +50,7 @@ class Pass; class AnalysisUsage; class MemTransferInst; class MemIntrinsic; +class DominatorTree; class AliasAnalysis { protected: @@ -462,6 +463,18 @@ public: virtual ModRefResult getModRefInfo(ImmutableCallSite CS1, ImmutableCallSite CS2); + /// callCapturesBefore - Return information about whether a particular call + /// site modifies or reads the specified memory location. + ModRefResult callCapturesBefore(const Instruction *I, + const AliasAnalysis::Location &MemLoc, + DominatorTree *DT); + + /// callCapturesBefore - A convenience wrapper. + ModRefResult callCapturesBefore(const Instruction *I, const Value *P, + uint64_t Size, DominatorTree *DT) { + return callCapturesBefore(I, Location(P, Size), DT); + } + //===--------------------------------------------------------------------===// /// Higher level methods for querying mod/ref information. /// diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h index 68ce364f44..81ad3f0aea 100644 --- a/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -431,9 +431,6 @@ namespace llvm { void RemoveCachedNonLocalPointerDependencies(ValueIsLoadPair P); - AliasAnalysis::ModRefResult - getModRefInfo(const Instruction *Inst, const AliasAnalysis::Location &Loc); - /// verifyRemoved - Verify that the specified instruction does not occur /// in our internal data structures. void verifyRemoved(Instruction *Inst) const; |