OSDN Git Service

[PM] Separate the LoopAnalysisManager from the LoopPassManager and move
authorChandler Carruth <chandlerc@gmail.com>
Wed, 11 Jan 2017 09:43:56 +0000 (09:43 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 11 Jan 2017 09:43:56 +0000 (09:43 +0000)
commitc68d25fb588754bc090517ad5effced8c791e5a5
treed83122f00261e30eed9be50e1793c648ac5d1590
parent6b834bb9ba811be6a7ec65d4f746f1241636a4fd
[PM] Separate the LoopAnalysisManager from the LoopPassManager and move
the latter to the Transforms library.

While the loop PM uses an analysis to form the IR units, the current
plan is to have the PM itself establish and enforce both loop simplified
form and LCSSA. This would be a layering violation in the analysis
library.

Fundamentally, the idea behind the loop PM is to *transform* loops in
addition to running passes over them, so it really seemed like the most
natural place to sink this was into the transforms library.

We can't just move *everything* because we also have loop analyses that
rely on a subset of the invariants. So this patch splits the the loop
infrastructure into the analysis management that has to be part of the
analysis library, and the transform-aware pass manager.

This also required splitting the loop analyses' printer passes out to
the transforms library, which makes sense to me as running these will
transform the code into LCSSA in theory.

I haven't split the unittest though because testing one component
without the other seems nearly intractable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291662 91177308-0d34-0410-b5e6-96231b3b80d8
44 files changed:
include/llvm/Analysis/IVUsers.h
include/llvm/Analysis/LoopAccessAnalysis.h
include/llvm/Analysis/LoopAnalysisManager.h [new file with mode: 0644]
include/llvm/Passes/PassBuilder.h
include/llvm/Transforms/Scalar/IVUsersPrinter.h [new file with mode: 0644]
include/llvm/Transforms/Scalar/IndVarSimplify.h
include/llvm/Transforms/Scalar/LICM.h
include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h [new file with mode: 0644]
include/llvm/Transforms/Scalar/LoopDeletion.h
include/llvm/Transforms/Scalar/LoopIdiomRecognize.h
include/llvm/Transforms/Scalar/LoopInstSimplify.h
include/llvm/Transforms/Scalar/LoopPassManager.h [moved from include/llvm/Analysis/LoopPassManager.h with 75% similarity]
include/llvm/Transforms/Scalar/LoopRotation.h
include/llvm/Transforms/Scalar/LoopSimplifyCFG.h
include/llvm/Transforms/Scalar/LoopStrengthReduce.h
include/llvm/Transforms/Scalar/LoopUnrollPass.h
include/llvm/Transforms/Vectorize/LoopVectorize.h
lib/Analysis/CMakeLists.txt
lib/Analysis/IVUsers.cpp
lib/Analysis/LoopAccessAnalysis.cpp
lib/Analysis/LoopAnalysisManager.cpp [moved from lib/Analysis/LoopPassManager.cpp with 71% similarity]
lib/Analysis/LoopPass.cpp
lib/LTO/LTOBackend.cpp
lib/Passes/PassBuilder.cpp
lib/Transforms/Scalar/CMakeLists.txt
lib/Transforms/Scalar/IVUsersPrinter.cpp [new file with mode: 0644]
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp [new file with mode: 0644]
lib/Transforms/Scalar/LoopDeletion.cpp
lib/Transforms/Scalar/LoopDistribute.cpp
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
lib/Transforms/Scalar/LoopInstSimplify.cpp
lib/Transforms/Scalar/LoopPassManager.cpp [new file with mode: 0644]
lib/Transforms/Scalar/LoopRotation.cpp
lib/Transforms/Scalar/LoopSimplifyCFG.cpp
lib/Transforms/Scalar/LoopSink.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
lib/Transforms/Scalar/LoopUnrollPass.cpp
tools/opt/NewPMDriver.cpp
unittests/Analysis/CMakeLists.txt
unittests/Transforms/CMakeLists.txt
unittests/Transforms/Scalar/CMakeLists.txt [new file with mode: 0644]
unittests/Transforms/Scalar/LoopPassManagerTest.cpp [moved from unittests/Analysis/LoopPassManagerTest.cpp with 99% similarity]