diff options
author | Dan Gohman <gohman@apple.com> | 2010-09-14 21:25:10 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-09-14 21:25:10 +0000 |
commit | b2143b6247901ae4eca2192ee134564c4f5f7853 (patch) | |
tree | 7991b48f4a6ee8090de80fbb9cb17c6ed75d6227 /lib/Analysis/TypeBasedAliasAnalysis.cpp | |
parent | fe3ac088ee0a536f60b3c30ad97703d5d6cd2167 (diff) |
Remove the experimental AliasAnalysis::getDependency interface, which
isn't a good level of abstraction for memdep. Instead, generalize
AliasAnalysis::alias and related interfaces with a new Location
class for describing a memory location. For now, this is the same
Pointer and Size as before, plus an additional field for a TBAA tag.
Also, introduce a fixed MD_tbaa metadata tag kind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/TypeBasedAliasAnalysis.cpp')
-rw-r--r-- | lib/Analysis/TypeBasedAliasAnalysis.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Analysis/TypeBasedAliasAnalysis.cpp b/lib/Analysis/TypeBasedAliasAnalysis.cpp index bbfdcec3f9..f6c8201c03 100644 --- a/lib/Analysis/TypeBasedAliasAnalysis.cpp +++ b/lib/Analysis/TypeBasedAliasAnalysis.cpp @@ -96,9 +96,8 @@ namespace { private: virtual void getAnalysisUsage(AnalysisUsage &AU) const; - virtual AliasResult alias(const Value *V1, unsigned V1Size, - const Value *V2, unsigned V2Size); - virtual bool pointsToConstantMemory(const Value *P); + virtual AliasResult alias(const Location &LocA, const Location &LocB); + virtual bool pointsToConstantMemory(const Location &Loc); }; } // End of anonymous namespace @@ -118,12 +117,12 @@ TypeBasedAliasAnalysis::getAnalysisUsage(AnalysisUsage &AU) const { } AliasAnalysis::AliasResult -TypeBasedAliasAnalysis::alias(const Value *A, unsigned ASize, - const Value *B, unsigned BSize) { +TypeBasedAliasAnalysis::alias(const Location &LocA, + const Location &LocB) { // Currently, metadata can only be attached to Instructions. - const Instruction *AI = dyn_cast<Instruction>(A); + const Instruction *AI = dyn_cast<Instruction>(LocA.Ptr); if (!AI) return MayAlias; - const Instruction *BI = dyn_cast<Instruction>(B); + const Instruction *BI = dyn_cast<Instruction>(LocB.Ptr); if (!BI) return MayAlias; // Get the attached MDNodes. If either value lacks a tbaa MDNode, we must @@ -175,9 +174,9 @@ TypeBasedAliasAnalysis::alias(const Value *A, unsigned ASize, return MayAlias; } -bool TypeBasedAliasAnalysis::pointsToConstantMemory(const Value *P) { +bool TypeBasedAliasAnalysis::pointsToConstantMemory(const Location &Loc) { // Currently, metadata can only be attached to Instructions. - const Instruction *I = dyn_cast<Instruction>(P); + const Instruction *I = dyn_cast<Instruction>(Loc.Ptr); if (!I) return false; MDNode *M = |