[flang-commits] [flang] 4755fb2 - Revert "[fir] Split FIROptimizer lib into several smaller libraries"

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Tue Oct 5 02:20:00 PDT 2021


Author: Valentin Clement
Date: 2021-10-05T11:19:53+02:00
New Revision: 4755fb2e187da57227a35166190d7eb337ec2ce2

URL: https://github.com/llvm/llvm-project/commit/4755fb2e187da57227a35166190d7eb337ec2ce2
DIFF: https://github.com/llvm/llvm-project/commit/4755fb2e187da57227a35166190d7eb337ec2ce2.diff

LOG: Revert "[fir] Split FIROptimizer lib into several smaller libraries"

This reverts commit c02a8cdda8733aac26481b6819a4eef000ee91c8.

Added: 
    flang/unittests/Lower/CMakeLists.txt
    flang/unittests/Lower/RTBuilder.cpp

Modified: 
    flang/lib/Lower/CMakeLists.txt
    flang/lib/Optimizer/CMakeLists.txt
    flang/tools/fir-opt/CMakeLists.txt
    flang/tools/tco/CMakeLists.txt
    flang/unittests/CMakeLists.txt
    flang/unittests/Optimizer/CMakeLists.txt

Removed: 
    flang/lib/Optimizer/CodeGen/CMakeLists.txt
    flang/lib/Optimizer/Dialect/CMakeLists.txt
    flang/lib/Optimizer/Support/CMakeLists.txt
    flang/lib/Optimizer/Transforms/CMakeLists.txt
    flang/unittests/Optimizer/RTBuilder.cpp


################################################################################
diff  --git a/flang/lib/Lower/CMakeLists.txt b/flang/lib/Lower/CMakeLists.txt
index 27e54d44893bc..07b87ef22ce92 100644
--- a/flang/lib/Lower/CMakeLists.txt
+++ b/flang/lib/Lower/CMakeLists.txt
@@ -17,15 +17,11 @@ add_flang_library(FortranLower
   PFTBuilder.cpp
 
   DEPENDS
-  FIRDialect
-  FIRSupport
-  FIRTransforms
+  FIROptimizer
   ${dialect_libs}
 
   LINK_LIBS
-  FIRDialect
-  FIRSupport
-  FIRTransforms
+  FIROptimizer
   ${dialect_libs}
   FortranCommon
   FortranParser

diff  --git a/flang/lib/Optimizer/CMakeLists.txt b/flang/lib/Optimizer/CMakeLists.txt
index 4b37a18340cfa..b83d6a079db63 100644
--- a/flang/lib/Optimizer/CMakeLists.txt
+++ b/flang/lib/Optimizer/CMakeLists.txt
@@ -1,4 +1,34 @@
-add_subdirectory(CodeGen)
-add_subdirectory(Dialect)
-add_subdirectory(Support)
-add_subdirectory(Transforms)
+get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
+
+add_flang_library(FIROptimizer
+  Dialect/FIRAttr.cpp
+  Dialect/FIRDialect.cpp
+  Dialect/FIROps.cpp
+  Dialect/FIRType.cpp
+
+  Support/FIRContext.cpp
+  Support/InternalNames.cpp
+  Support/KindMapping.cpp
+
+  CodeGen/CGOps.cpp
+  CodeGen/PreCGRewrite.cpp
+
+  Transforms/Inliner.cpp
+
+  DEPENDS
+  FIROpsIncGen
+  FIROptCodeGenPassIncGen
+  FIROptTransformsPassIncGen
+  CGOpsIncGen
+  ${dialect_libs}
+
+  LINK_LIBS
+  ${dialect_libs}
+  MLIRLLVMToLLVMIRTranslation
+  MLIRTargetLLVMIRExport
+
+  LINK_COMPONENTS
+  AsmParser
+  AsmPrinter
+  Remarks
+)

diff  --git a/flang/lib/Optimizer/CodeGen/CMakeLists.txt b/flang/lib/Optimizer/CodeGen/CMakeLists.txt
deleted file mode 100644
index 6a8d82cb1f671..0000000000000
--- a/flang/lib/Optimizer/CodeGen/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-add_flang_library(FIRCodeGen
-  CGOps.cpp
-  PreCGRewrite.cpp
-
-  DEPENDS
-  FIRDialect
-  FIRSupport
-  FIROptCodeGenPassIncGen
-  CGOpsIncGen
-
-  LINK_LIBS
-  FIRDialect
-  FIRSupport
-  MLIROpenMPToLLVM
-  MLIRLLVMToLLVMIRTranslation
-  MLIRTargetLLVMIRExport
-
-  LINK_COMPONENTS
-  AsmParser
-  AsmPrinter
-  Remarks
-)

diff  --git a/flang/lib/Optimizer/Dialect/CMakeLists.txt b/flang/lib/Optimizer/Dialect/CMakeLists.txt
deleted file mode 100644
index 7116dab90b6f0..0000000000000
--- a/flang/lib/Optimizer/Dialect/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-add_flang_library(FIRDialect
-  FIRAttr.cpp
-  FIRDialect.cpp
-  FIROps.cpp
-  FIRType.cpp
-
-  DEPENDS
-  FIRSupport
-  FIROpsIncGen
-
-  LINK_LIBS
-  FIRSupport
-  MLIROpenMPToLLVM
-  MLIRLLVMToLLVMIRTranslation
-  MLIRTargetLLVMIRExport
-
-  LINK_COMPONENTS
-  AsmParser
-  AsmPrinter
-  Remarks
-)

diff  --git a/flang/lib/Optimizer/Support/CMakeLists.txt b/flang/lib/Optimizer/Support/CMakeLists.txt
deleted file mode 100644
index 46fe7aa24aa7a..0000000000000
--- a/flang/lib/Optimizer/Support/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-add_flang_library(FIRSupport
-  FIRContext.cpp
-  InternalNames.cpp
-  KindMapping.cpp
-
-  DEPENDS
-  ${dialect_libs}
-  MLIRIR
-
-  LINK_LIBS
-  ${dialect_libs}
-  MLIROpenMPToLLVMIRTranslation
-  MLIRLLVMToLLVMIRTranslation
-  MLIRTargetLLVMIRExport
-)

diff  --git a/flang/lib/Optimizer/Transforms/CMakeLists.txt b/flang/lib/Optimizer/Transforms/CMakeLists.txt
deleted file mode 100644
index 462ae40354d62..0000000000000
--- a/flang/lib/Optimizer/Transforms/CMakeLists.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-add_flang_library(FIRTransforms
-  Inliner.cpp
-
-  DEPENDS
-  FIRDialect
-  FIRSupport
-  FIROptTransformsPassIncGen
-
-  LINK_LIBS
-  FIRDialect
-  MLIRAffineToStandard
-  MLIRLLVMIR
-  MLIROpenACC
-  MLIROpenMP
-  FIRSupport
-)

diff  --git a/flang/tools/fir-opt/CMakeLists.txt b/flang/tools/fir-opt/CMakeLists.txt
index 566aa787e7c35..efd33f9826b98 100644
--- a/flang/tools/fir-opt/CMakeLists.txt
+++ b/flang/tools/fir-opt/CMakeLists.txt
@@ -3,10 +3,7 @@ llvm_update_compile_flags(fir-opt)
 get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
 
 target_link_libraries(fir-opt PRIVATE
-  FIRDialect
-  FIRSupport
-  FIRTransforms
-  FIRCodeGen
+  FIROptimizer
   ${dialect_libs}
 
   # TODO: these should be transitive dependencies from a target providing

diff  --git a/flang/tools/tco/CMakeLists.txt b/flang/tools/tco/CMakeLists.txt
index 1a9c5ac72f153..4a22427486d71 100644
--- a/flang/tools/tco/CMakeLists.txt
+++ b/flang/tools/tco/CMakeLists.txt
@@ -1,10 +1,7 @@
 get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
 
 set(LIBS
-  FIRCodeGen
-  FIRDialect
-  FIRSupport
-  FIRTransforms
+  FIROptimizer
   ${dialect_libs}
   MLIRIR
   MLIRLLVMIR

diff  --git a/flang/unittests/CMakeLists.txt b/flang/unittests/CMakeLists.txt
index 5acebce7192af..95e3f6d611dd6 100644
--- a/flang/unittests/CMakeLists.txt
+++ b/flang/unittests/CMakeLists.txt
@@ -39,5 +39,6 @@ endfunction()
 add_subdirectory(Optimizer)
 add_subdirectory(Decimal)
 add_subdirectory(Evaluate)
+add_subdirectory(Lower)
 add_subdirectory(Runtime)
 add_subdirectory(Frontend)

diff  --git a/flang/unittests/Lower/CMakeLists.txt b/flang/unittests/Lower/CMakeLists.txt
new file mode 100644
index 0000000000000..a3f61f0be5ed9
--- /dev/null
+++ b/flang/unittests/Lower/CMakeLists.txt
@@ -0,0 +1,15 @@
+get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
+
+set(LIBS
+  FIROptimizer
+  MLIRLLVMIR
+  ${dialect_libs}
+)
+
+add_flang_unittest(FlangLoweringTests
+  RTBuilder.cpp
+)
+
+target_link_libraries(FlangLoweringTests
+  PRIVATE
+  ${LIBS})

diff  --git a/flang/unittests/Optimizer/RTBuilder.cpp b/flang/unittests/Lower/RTBuilder.cpp
similarity index 100%
rename from flang/unittests/Optimizer/RTBuilder.cpp
rename to flang/unittests/Lower/RTBuilder.cpp

diff  --git a/flang/unittests/Optimizer/CMakeLists.txt b/flang/unittests/Optimizer/CMakeLists.txt
index 8bfb8604b4127..3996c69b1a982 100644
--- a/flang/unittests/Optimizer/CMakeLists.txt
+++ b/flang/unittests/Optimizer/CMakeLists.txt
@@ -1,9 +1,7 @@
 get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
 
 set(LIBS
-  FIRCodeGen
-  FIRDialect
-  FIRSupport
+  FIROptimizer
   ${dialect_libs}
 )
 
@@ -11,7 +9,6 @@ add_flang_unittest(FlangOptimizerTests
   FIRContextTest.cpp
   InternalNamesTest.cpp
   KindMappingTest.cpp
-  RTBuilder.cpp
 )
 target_link_libraries(FlangOptimizerTests
   PRIVATE


        


More information about the flang-commits mailing list