diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-07-22 23:15:57 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-07-22 23:15:57 +0000 |
commit | 194f59ca5d2f48f1e0b7fa95971ae9f88e95ba95 (patch) | |
tree | 67fa8610cb1dccceeb055c823d16d438fed256d5 /llvm/lib/Analysis/AliasAnalysisCounter.cpp | |
parent | 16fe4d178e9d81b07e8deb59a4b4292850364898 (diff) | |
download | bcm5719-llvm-194f59ca5d2f48f1e0b7fa95971ae9f88e95ba95.tar.gz bcm5719-llvm-194f59ca5d2f48f1e0b7fa95971ae9f88e95ba95.zip |
[PM/AA] Extract the ModRef enums from the AliasAnalysis class in
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
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysisCounter.cpp')
-rw-r--r-- | llvm/lib/Analysis/AliasAnalysisCounter.cpp | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysisCounter.cpp b/llvm/lib/Analysis/AliasAnalysisCounter.cpp index 9b6a5a44d80..6c53b41d3a1 100644 --- a/llvm/lib/Analysis/AliasAnalysisCounter.cpp +++ b/llvm/lib/Analysis/AliasAnalysisCounter.cpp @@ -62,15 +62,16 @@ namespace { << Must*100/AASum<<"%\n\n"; } - errs() << " " << MRSum << " Total Mod/Ref Queries Performed\n"; + errs() << " " << MRSum << " Total MRI_Mod/MRI_Ref Queries Performed\n"; if (MRSum) { printLine("no mod/ref", NoMR, MRSum); printLine("ref", JustRef, MRSum); printLine("mod", JustMod, MRSum); printLine("mod/ref", MR, MRSum); - errs() << " Mod/Ref Analysis Counter Summary: " <<NoMR*100/MRSum - << "%/" << JustRef*100/MRSum << "%/" << JustMod*100/MRSum - << "%/" << MR*100/MRSum <<"%\n\n"; + errs() << " MRI_Mod/MRI_Ref Analysis Counter Summary: " + << NoMR * 100 / MRSum << "%/" << JustRef * 100 / MRSum << "%/" + << JustMod * 100 / MRSum << "%/" << MR * 100 / MRSum + << "%\n\n"; } } } @@ -108,10 +109,10 @@ namespace { AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB) override; - ModRefResult getModRefInfo(ImmutableCallSite CS, - const MemoryLocation &Loc) override; - ModRefResult getModRefInfo(ImmutableCallSite CS1, - ImmutableCallSite CS2) override { + ModRefInfo getModRefInfo(ImmutableCallSite CS, + const MemoryLocation &Loc) override; + ModRefInfo getModRefInfo(ImmutableCallSite CS1, + ImmutableCallSite CS2) override { return AliasAnalysis::getModRefInfo(CS1,CS2); } }; @@ -150,20 +151,31 @@ AliasResult AliasAnalysisCounter::alias(const MemoryLocation &LocA, return R; } -AliasAnalysis::ModRefResult -AliasAnalysisCounter::getModRefInfo(ImmutableCallSite CS, - const MemoryLocation &Loc) { - ModRefResult R = getAnalysis<AliasAnalysis>().getModRefInfo(CS, Loc); +ModRefInfo AliasAnalysisCounter::getModRefInfo(ImmutableCallSite CS, + const MemoryLocation &Loc) { + ModRefInfo R = getAnalysis<AliasAnalysis>().getModRefInfo(CS, Loc); const char *MRString = nullptr; switch (R) { - case NoModRef: NoMR++; MRString = "NoModRef"; break; - case Ref: JustRef++; MRString = "JustRef"; break; - case Mod: JustMod++; MRString = "JustMod"; break; - case ModRef: MR++; MRString = "ModRef"; break; + case MRI_NoModRef: + NoMR++; + MRString = "MRI_NoModRef"; + break; + case MRI_Ref: + JustRef++; + MRString = "JustRef"; + break; + case MRI_Mod: + JustMod++; + MRString = "JustMod"; + break; + case MRI_ModRef: + MR++; + MRString = "MRI_ModRef"; + break; } - if (PrintAll || (PrintAllFailures && R == ModRef)) { + if (PrintAll || (PrintAllFailures && R == MRI_ModRef)) { errs() << MRString << ": Ptr: "; errs() << "[" << Loc.Size << "B] "; Loc.Ptr->printAsOperand(errs(), true, M); |