[MLIR] Break cyclic dependencies with MLIRAnalysis

Summary:

MLIRAnalysis depended on MLIRVectorOps
MLIRVectorOps depended on MLIRAnalysis for Loop information.

Both of these can be solved by factoring out libraries related to loop
analysis into their own library. The new MLIRLoopAnalysis might be
better off with the Loop Dialect in the future.

Reviewers: nicolasvasilache, rriddle!, mehdi_amini

Reviewed By: mehdi_amini

Subscribers: Joonsoo, vchuravy, merge_guards_bot, mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73655
This commit is contained in:
Stephen Neuendorffer 2020-01-29 11:20:19 -08:00
parent b692f43e42
commit 7b7e505813
3 changed files with 32 additions and 2 deletions

View File

@ -1,4 +1,4 @@
add_llvm_library(MLIRAnalysis STATIC
set(LLVM_OPTIONAL_SOURCES
AffineAnalysis.cpp
AffineStructures.cpp
CallGraph.cpp
@ -10,6 +10,15 @@ add_llvm_library(MLIRAnalysis STATIC
SliceAnalysis.cpp
Utils.cpp
Verifier.cpp
)
add_llvm_library(MLIRAnalysis
CallGraph.cpp
InferTypeOpInterface.cpp
Liveness.cpp
SliceAnalysis.cpp
Dominance.cpp
Verifier.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis
@ -20,4 +29,24 @@ add_dependencies(MLIRAnalysis
MLIRTypeInferOpInterfaceIncGen
MLIRLoopOps
)
target_link_libraries(MLIRAnalysis MLIRAffineOps MLIRLoopOps)
add_llvm_library(MLIRLoopAnalysis
AffineAnalysis.cpp
AffineStructures.cpp
LoopAnalysis.cpp
NestedMatcher.cpp
Utils.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis
)
add_dependencies(MLIRLoopAnalysis
MLIRAffineOps
MLIRCallOpInterfacesIncGen
MLIRTypeInferOpInterfaceIncGen
MLIRLoopOps
)
target_link_libraries(MLIRLoopAnalysis MLIRAffineOps MLIRLoopOps)

View File

@ -11,4 +11,4 @@ add_llvm_library(MLIRVectorOps
add_dependencies(MLIRVectorOps MLIRVectorOpsIncGen)
add_dependencies(MLIRVectorOps MLIRVectorTransformPatternsIncGen)
target_link_libraries(MLIRVectorOps MLIRAnalysis MLIRIR MLIRStandardOps MLIRAffineOps MLIRLoopOps)
target_link_libraries(MLIRVectorOps MLIRIR MLIRStandardOps MLIRAffineOps MLIRLoopOps MLIRLoopAnalysis)

View File

@ -15,6 +15,7 @@ add_dependencies(MLIRTransformUtils MLIRStandardOpsIncGen)
target_link_libraries(MLIRTransformUtils
MLIRAffineOps
MLIRAnalysis
MLIRLoopAnalysis
MLIRLoopOps
MLIRPass
MLIRStandardOps