OSDN Git Service

[AliasAnalysis] Second prototype to cache BasicAA / anyAA state.
authorAlina Sbirlea <asbirlea@google.com>
Fri, 22 Mar 2019 17:22:19 +0000 (17:22 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Fri, 22 Mar 2019 17:22:19 +0000 (17:22 +0000)
commit5bfa50e0acbab544f8430c003d10dd995d48dac4
treee74175efac47a42ff9c0c901ef37c122282f4abc
parent431bb12d06bf46c96c9992a0ca75e67ef562eb0e
[AliasAnalysis] Second prototype to cache BasicAA / anyAA state.

Summary:
Adding contained caching to AliasAnalysis. BasicAA is currently the only one using it.

AA changes:
- This patch is pulling the caches from BasicAAResults to AAResults, meaning the getModRefInfo call benefits from the IsCapturedCache as well when in "batch mode".
- All AAResultBase implementations add the QueryInfo member to all APIs. AAResults APIs maintain wrapper APIs such that all alias()/getModRefInfo call sites are unchanged.
- AA now provides a BatchAAResults type as a wrapper to AAResults. It keeps the AAResults instance and a QueryInfo instantiated to batch mode. It delegates all work to the AAResults instance with the batched QueryInfo. More API wrappers may be needed in BatchAAResults; only the minimum needed is currently added.

MemorySSA changes:
- All walkers are now templated on the AA used (AliasAnalysis=AAResults or BatchAAResults).
- At build time, we optimize uses; now we create a local walker (lives only as long as OptimizeUses does) using BatchAAResults.
- All Walkers have an internal AA and only use that now, never the AA in MemorySSA. The Walkers receive the AA they will use when built.

- The walker we use for queries after the build is instantiated on AliasAnalysis and is built after building MemorySSA and setting AA.
- All static methods doing walking are now templated on AliasAnalysisType if they are used both during build and after. If used only during build, the method now only takes a BatchAAResults. If used only after build, the method now takes an AliasAnalysis.

Subscribers: sanjoy, arsenm, jvesely, nhaehnle, jlebar, george.burgess.iv, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59315

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356783 91177308-0d34-0410-b5e6-96231b3b80d8
23 files changed:
include/llvm/Analysis/AliasAnalysis.h
include/llvm/Analysis/BasicAliasAnalysis.h
include/llvm/Analysis/CFLAndersAliasAnalysis.h
include/llvm/Analysis/CFLSteensAliasAnalysis.h
include/llvm/Analysis/GlobalsModRef.h
include/llvm/Analysis/MemorySSA.h
include/llvm/Analysis/ObjCARCAliasAnalysis.h
include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h
include/llvm/Analysis/ScopedNoAliasAA.h
include/llvm/Analysis/TypeBasedAliasAnalysis.h
lib/Analysis/AliasAnalysis.cpp
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/CFLAndersAliasAnalysis.cpp
lib/Analysis/GlobalsModRef.cpp
lib/Analysis/MemorySSA.cpp
lib/Analysis/ObjCARCAliasAnalysis.cpp
lib/Analysis/ScalarEvolutionAliasAnalysis.cpp
lib/Analysis/ScopedNoAliasAA.cpp
lib/Analysis/TypeBasedAliasAnalysis.cpp
lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
unittests/Analysis/AliasAnalysisTest.cpp
unittests/Analysis/BasicAliasAnalysisTest.cpp