Skip to content

[mlir] Revise IDE folder structure #89749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# MLIR project.
cmake_minimum_required(VERSION 3.20.0)
set(LLVM_SUBPROJECT_TITLE "MLIR")

if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
Expand Down Expand Up @@ -96,12 +97,13 @@ endif()
# tablegen'd targets.
# mlir-generic-headers are dialect-independent.
add_custom_target(mlir-generic-headers)
set_target_properties(mlir-generic-headers PROPERTIES FOLDER "Misc")
set_target_properties(mlir-generic-headers PROPERTIES FOLDER "MLIR/Resources")
# mlir-headers may be dialect-dependent.
add_custom_target(mlir-headers)
set_target_properties(mlir-headers PROPERTIES FOLDER "Misc")
set_target_properties(mlir-headers PROPERTIES FOLDER "MLIR/Resources")
add_dependencies(mlir-headers mlir-generic-headers)
add_custom_target(mlir-doc)
set_target_properties(mlir-doc PROPERTIES FOLDER "MLIR/Docs")

# Only enable execution engine if the native target is available.
if(${LLVM_NATIVE_ARCH} IN_LIST LLVM_TARGETS_TO_BUILD)
Expand Down Expand Up @@ -193,6 +195,7 @@ add_subdirectory(lib/CAPI)
if (MLIR_INCLUDE_TESTS)
add_definitions(-DMLIR_INCLUDE_TESTS)
add_custom_target(MLIRUnitTests)
set_target_properties(MLIRUnitTests PROPERTIES FOLDER "MLIR/Tests")
if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
add_subdirectory(unittests)
else()
Expand Down Expand Up @@ -253,7 +256,7 @@ endif()

# Custom target to install all mlir libraries
add_custom_target(mlir-libraries)
set_target_properties(mlir-libraries PROPERTIES FOLDER "Misc")
set_target_properties(mlir-libraries PROPERTIES FOLDER "MLIR/Metatargets")

if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-mlir-libraries
Expand Down
5 changes: 3 additions & 2 deletions mlir/cmake/modules/AddMLIR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ function(add_mlir_doc doc_filename output_file output_directory command)
${GEN_DOC_FILE}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${output_file}.md)
add_custom_target(${output_file}DocGen DEPENDS ${GEN_DOC_FILE})
set_target_properties(${output_file}DocGen PROPERTIES FOLDER "MLIR/Tablegenning/Docs")
add_dependencies(mlir-doc ${output_file}DocGen)
endfunction()

Expand Down Expand Up @@ -290,7 +291,7 @@ function(add_mlir_example_library name)
list(APPEND ARG_DEPENDS mlir-generic-headers)

llvm_add_library(${name} ${LIBTYPE} ${ARG_UNPARSED_ARGUMENTS} ${srcs} DEPENDS ${ARG_DEPENDS} LINK_COMPONENTS ${ARG_LINK_COMPONENTS} LINK_LIBS ${ARG_LINK_LIBS})
set_target_properties(${name} PROPERTIES FOLDER "Examples")
set_target_properties(${name} PROPERTIES FOLDER "MLIR/Examples")
if (LLVM_BUILD_EXAMPLES AND NOT ${ARG_DISABLE_INSTALL})
add_mlir_library_install(${name})
else()
Expand Down Expand Up @@ -367,7 +368,7 @@ function(add_mlir_library name)
# Add empty "phony" target
add_custom_target(${name})
endif()
set_target_properties(${name} PROPERTIES FOLDER "MLIR libraries")
set_target_properties(${name} PROPERTIES FOLDER "MLIR/Libraries")

# Setup aggregate.
if(ARG_ENABLE_AGGREGATION)
Expand Down
1 change: 1 addition & 0 deletions mlir/docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ if (LLVM_ENABLE_DOXYGEN)
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating mlir doxygen documentation." VERBATIM)
set_target_properties(doxygen-mlir PROPERTIES FOLDER "MLIR/Docs")

if (LLVM_BUILD_DOCS)
add_dependencies(doxygen doxygen-mlir)
Expand Down
2 changes: 1 addition & 1 deletion mlir/examples/toy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_custom_target(Toy)
set_target_properties(Toy PROPERTIES FOLDER Examples)
set_target_properties(Toy PROPERTIES FOLDER "MLIR/Examples")

macro(add_toy_chapter name)
add_dependencies(Toy ${name})
Expand Down
1 change: 1 addition & 0 deletions mlir/examples/transform/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
add_custom_target(TransformExample)
set_target_properties(TransformExample PROPERTIES FOLDER "MLIR/Examples")

add_subdirectory(Ch2)
add_subdirectory(Ch3)
Expand Down
2 changes: 2 additions & 0 deletions mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function(add_linalg_ods_yaml_gen yaml_ast_file output_file)
${MLIR_LINALG_ODS_YAML_GEN_EXE}
${MLIR_LINALG_ODS_YAML_GEN_TARGET}
${GEN_ODS_FILE} ${GEN_CPP_FILE})
set_target_properties(MLIR${output_file}YamlIncGen PROPERTIES FOLDER "MLIR/Tablegenning")
list(APPEND LLVM_TARGET_DEPENDS ${GEN_ODS_FILE})
set(LLVM_TARGET_DEPENDS ${LLVM_TARGET_DEPENDS} PARENT_SCOPE)
endfunction()
Expand All @@ -40,6 +41,7 @@ add_custom_target(LinalgOdsGen
DEPENDS
MLIRLinalgNamedStructuredOpsYamlIncGen
)
set_target_properties(LinalgOdsGen PROPERTIES FOLDER "MLIR/Tablegenning")
add_dependencies(mlir-headers LinalgOdsGen)

add_mlir_dialect(LinalgOps linalg)
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/TableGen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ llvm_add_library(MLIRTableGen STATIC
${MLIR_MAIN_INCLUDE_DIR}/mlir/TableGen
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support
)
set_target_properties(MLIRTableGen PROPERTIES FOLDER "MLIR/Tablegenning")

mlir_check_all_link_libraries(MLIRTableGen)

Expand Down
2 changes: 2 additions & 0 deletions mlir/test/CAPI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ function(_add_capi_test_executable name)
add_llvm_executable(${name}
PARTIAL_SOURCES_INTENDED
${ARG_UNPARSED_ARGUMENTS})
set_target_properties(${name} PROPERTIES FOLDER "MLIR/Tests")

llvm_update_compile_flags(${name})
if(MLIR_BUILD_MLIR_C_DYLIB)
target_link_libraries(${name} PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ endif()
add_custom_target(check-mlir-build-only
DEPENDS ${MLIR_TEST_DEPENDS}
)
set_target_properties(check-mlir-build-only PROPERTIES FOLDER "MLIR/Tests")

add_lit_testsuite(check-mlir "Running the MLIR regression tests"
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${MLIR_TEST_DEPENDS}
)
set_target_properties(check-mlir PROPERTIES FOLDER "Tests")

add_lit_testsuites(MLIR ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${MLIR_TEST_DEPENDS}
Expand Down
1 change: 1 addition & 0 deletions mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ setup_host_tool(mlir-linalg-ods-yaml-gen MLIR_LINALG_ODS_YAML_GEN MLIR_LINALG_OD

if(NOT ${MLIR_LINALG_ODS_YAML_GEN_EXE} STREQUAL "mlir-linalg-ods-yaml-gen")
add_custom_target(mlir-linalg-ods-yaml-gen-host DEPENDS ${MLIR_LINALG_ODS_YAML_GEN_EXE})
set_target_properties(mlir-linalg-ods-yaml-gen-host PROPERTIES FOLDER "MLIR/Tablegenning")

if(NOT LLVM_BUILD_UTILS)
set_target_properties(mlir-linalg-ods-yaml-gen PROPERTIES EXCLUDE_FROM_ALL ON)
Expand Down
1 change: 0 additions & 1 deletion mlir/tools/mlir-pdll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ add_tablegen(mlir-pdll MLIR_PDLL
${LIBS}
)

set_target_properties(mlir-pdll PROPERTIES FOLDER "Tablegenning")
target_link_libraries(mlir-pdll PRIVATE ${LIBS})

mlir_check_all_link_libraries(mlir-pdll)
2 changes: 1 addition & 1 deletion mlir/tools/mlir-src-sharder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ add_tablegen(mlir-src-sharder MLIR_SRC_SHARDER
${LIBS}
)

set_target_properties(mlir-src-sharder PROPERTIES FOLDER "Tablegenning")
set_target_properties(mlir-src-sharder PROPERTIES FOLDER "MLIR/Tablegenning")
target_link_libraries(mlir-src-sharder PRIVATE ${LIBS})

mlir_check_all_link_libraries(mlir-src-sharder)
1 change: 0 additions & 1 deletion mlir/tools/mlir-tblgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ add_tablegen(mlir-tblgen MLIR
SPIRVUtilsGen.cpp
)

set_target_properties(mlir-tblgen PROPERTIES FOLDER "Tablegenning")
target_link_libraries(mlir-tblgen
PRIVATE
MLIRTblgenLib)
Expand Down
2 changes: 0 additions & 2 deletions mlir/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
set_target_properties(MLIRUnitTests PROPERTIES FOLDER "MLIR Tests")

# To silence warning caused by Wundef.
add_definitions(-DGTEST_NO_LLVM_SUPPORT=0)

Expand Down
Loading