[PM] Split the AssumptionTracker immutable pass into two separate APIs:
authorChandler Carruth <chandlerc@gmail.com>
Sun, 4 Jan 2015 12:03:27 +0000 (12:03 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 4 Jan 2015 12:03:27 +0000 (12:03 +0000)
commit5a9cd4d44e4bd15f835aec280ea158d2c7c5a920
tree0bf1cb0115ea08c4e0a601ea6af0e516724d04b6
parent07d7dbae9eb59eef7a44cfe257e7475e75b06ffd
[PM] Split the AssumptionTracker immutable pass into two separate APIs:
a cache of assumptions for a single function, and an immutable pass that
manages those caches.

The motivation for this change is two fold. Immutable analyses are
really hacks around the current pass manager design and don't exist in
the new design. This is usually OK, but it requires that the core logic
of an immutable pass be reasonably partitioned off from the pass logic.
This change does precisely that. As a consequence it also paves the way
for the *many* utility functions that deal in the assumptions to live in
both pass manager worlds by creating an separate non-pass object with
its own independent API that they all rely on. Now, the only bits of the
system that deal with the actual pass mechanics are those that actually
need to deal with the pass mechanics.

Once this separation is made, several simplifications become pretty
obvious in the assumption cache itself. Rather than using a set and
callback value handles, it can just be a vector of weak value handles.
The callers can easily skip the handles that are null, and eventually we
can wrap all of this up behind a filter iterator.

For now, this adds boiler plate to the various passes, but this kind of
boiler plate will end up making it possible to port these passes to the
new pass manager, and so it will end up factored away pretty reasonably.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225131 91177308-0d34-0410-b5e6-96231b3b80d8
65 files changed:
include/llvm/Analysis/AssumptionCache.h [new file with mode: 0644]
include/llvm/Analysis/AssumptionTracker.h [deleted file]
include/llvm/Analysis/CodeMetrics.h
include/llvm/Analysis/InlineCost.h
include/llvm/Analysis/InstructionSimplify.h
include/llvm/Analysis/LazyValueInfo.h
include/llvm/Analysis/MemoryDependenceAnalysis.h
include/llvm/Analysis/PHITransAddr.h
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Analysis/ValueTracking.h
include/llvm/InitializePasses.h
include/llvm/Transforms/Utils/Cloning.h
include/llvm/Transforms/Utils/Local.h
include/llvm/Transforms/Utils/LoopUtils.h
include/llvm/Transforms/Utils/PromoteMemToReg.h
include/llvm/Transforms/Utils/UnrollLoop.h
lib/Analysis/AssumptionCache.cpp [new file with mode: 0644]
lib/Analysis/AssumptionTracker.cpp [deleted file]
lib/Analysis/BasicAliasAnalysis.cpp
lib/Analysis/CMakeLists.txt
lib/Analysis/CodeMetrics.cpp
lib/Analysis/IPA/InlineCost.cpp
lib/Analysis/InstructionSimplify.cpp
lib/Analysis/LazyValueInfo.cpp
lib/Analysis/Lint.cpp
lib/Analysis/MemoryDependenceAnalysis.cpp
lib/Analysis/PHITransAddr.cpp
lib/Analysis/ScalarEvolution.cpp
lib/Analysis/ScalarEvolutionExpander.cpp
lib/Analysis/ValueTracking.cpp
lib/Transforms/IPO/InlineAlways.cpp
lib/Transforms/IPO/InlineSimple.cpp
lib/Transforms/IPO/Inliner.cpp
lib/Transforms/InstCombine/InstCombine.h
lib/Transforms/InstCombine/InstCombineAddSub.cpp
lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
lib/Transforms/InstCombine/InstCombineCalls.cpp
lib/Transforms/InstCombine/InstCombineCompares.cpp
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
lib/Transforms/InstCombine/InstCombinePHI.cpp
lib/Transforms/InstCombine/InstCombineSelect.cpp
lib/Transforms/InstCombine/InstCombineShifts.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp
lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
lib/Transforms/Scalar/EarlyCSE.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Scalar/LoopInstSimplify.cpp
lib/Transforms/Scalar/LoopRotation.cpp
lib/Transforms/Scalar/LoopUnrollPass.cpp
lib/Transforms/Scalar/LoopUnswitch.cpp
lib/Transforms/Scalar/MemCpyOptimizer.cpp
lib/Transforms/Scalar/SROA.cpp
lib/Transforms/Scalar/ScalarReplAggregates.cpp
lib/Transforms/Scalar/SimplifyCFGPass.cpp
lib/Transforms/Utils/InlineFunction.cpp
lib/Transforms/Utils/Local.cpp
lib/Transforms/Utils/LoopSimplify.cpp
lib/Transforms/Utils/LoopUnroll.cpp
lib/Transforms/Utils/Mem2Reg.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
lib/Transforms/Utils/SimplifyInstructions.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp
lib/Transforms/Vectorize/SLPVectorizer.cpp