Skip to content

Commit

Permalink
[CMake] Add new cmake option to control adding comments in GenDAGISel
Browse files Browse the repository at this point in the history
Add new cmake option `LLVM_OMIT_DAGISEL_COMMENTS` to control adding
of comments in GenDAGISel for none debug builds

Ref: https://reviews.llvm.org/D78884

Reviewed By: nemanjai, MaskRay, #powerpc

Differential Revision: https://reviews.llvm.org/D114122
  • Loading branch information
lei137 committed Nov 25, 2021
1 parent 66d4ce7 commit 1db1cb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions llvm/CMakeLists.txt
Expand Up @@ -646,6 +646,11 @@ if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS
set(LLVM_USE_HOST_TOOLS ON)
endif()

option(LLVM_OMIT_DAGISEL_COMMENTS "Do not add comments to DAG ISel" ON)
if (CMAKE_BUILD_TYPE AND uppercase_CMAKE_BUILD_TYPE MATCHES "^(RELWITHDEBINFO|DEBUG)$")
set(LLVM_OMIT_DAGISEL_COMMENTS OFF)
endif()

if (MSVC_IDE)
option(LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION "Configure project to use Visual Studio native visualizers" TRUE)
endif()
Expand Down
5 changes: 1 addition & 4 deletions llvm/cmake/modules/TableGen.cmake
Expand Up @@ -53,10 +53,7 @@ function(tablegen project ofn)
list(APPEND LLVM_TABLEGEN_FLAGS "-gisel-coverage-file=${LLVM_GISEL_COV_PREFIX}all")
endif()
endif()
# Comments are only useful for Debug builds. Omit them if the backend
# supports it.
if (NOT (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR
uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO"))
if (LLVM_OMIT_DAGISEL_COMMENTS)
list(FIND ARGN "-gen-dag-isel" idx)
if (NOT idx EQUAL -1)
list(APPEND LLVM_TABLEGEN_FLAGS "-omit-comments")
Expand Down

0 comments on commit 1db1cb0

Please sign in to comment.