Skip to content

Commit

Permalink
[PM/AA] Extract the ModRef enums from the AliasAnalysis class in
Browse files Browse the repository at this point in the history
preparation for de-coupling the AA implementations.

In order to do this, they had to become fake-scoped using the
traditional LLVM pattern of a leading initialism. These can't be actual
scoped enumerations because they're bitfields and thus inherently we use
them as integers.

I've also renamed the behavior enums that are specific to reasoning
about the mod/ref behavior of functions when called. This makes it more
clear that they have a very narrow domain of applicability.

I think there is a significantly cleaner API for all of this, but
I don't want to try to do really substantive changes for now, I just
want to refactor the things away from analysis groups so I'm preserving
the exact original design and just cleaning up the names, style, and
lifting out of the class.

Differential Revision: http://reviews.llvm.org/D10564

llvm-svn: 242963
  • Loading branch information
chandlerc committed Jul 22, 2015
1 parent 16fe4d1 commit 194f59c
Show file tree
Hide file tree
Showing 32 changed files with 523 additions and 510 deletions.
245 changes: 131 additions & 114 deletions llvm/include/llvm/Analysis/AliasAnalysis.h

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions llvm/include/llvm/Analysis/LibCallAliasAnalysis.h
Expand Up @@ -38,11 +38,11 @@ namespace llvm {
}
~LibCallAliasAnalysis() override;

ModRefResult getModRefInfo(ImmutableCallSite CS,
const MemoryLocation &Loc) override;
ModRefInfo getModRefInfo(ImmutableCallSite CS,
const MemoryLocation &Loc) override;

ModRefResult getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) override {
ModRefInfo getModRefInfo(ImmutableCallSite CS1,
ImmutableCallSite CS2) override {
// TODO: Could compare two direct calls against each other if we cared to.
return AliasAnalysis::getModRefInfo(CS1, CS2);
}
Expand All @@ -62,9 +62,9 @@ namespace llvm {
}

private:
ModRefResult AnalyzeLibCallDetails(const LibCallFunctionInfo *FI,
ImmutableCallSite CS,
const MemoryLocation &Loc);
ModRefInfo AnalyzeLibCallDetails(const LibCallFunctionInfo *FI,
ImmutableCallSite CS,
const MemoryLocation &Loc);
};
} // End of llvm namespace

Expand Down
6 changes: 3 additions & 3 deletions llvm/include/llvm/Analysis/LibCallSemantics.h
Expand Up @@ -71,15 +71,15 @@ class InvokeInst;
/// any specific context knowledge. For example, if the function is known
/// to be readonly, this would be set to 'ref'. If known to be readnone,
/// this is set to NoModRef.
AliasAnalysis::ModRefResult UniversalBehavior;
ModRefInfo UniversalBehavior;

/// LocationMRInfo - This pair captures info about whether a specific
/// location is modified or referenced by a libcall.
struct LocationMRInfo {
/// LocationID - ID # of the accessed location or ~0U for array end.
unsigned LocationID;
/// MRInfo - Mod/Ref info for this location.
AliasAnalysis::ModRefResult MRInfo;
ModRefInfo MRInfo;
};

/// DetailsType - Indicate the sense of the LocationDetails array. This
Expand Down

0 comments on commit 194f59c

Please sign in to comment.