[llvm] 1db1cb0 - [CMake] Add new cmake option to control adding comments in GenDAGISel

Lei Huang via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 25 10:11:41 PST 2021


Author: Lei Huang
Date: 2021-11-25T12:11:35-06:00
New Revision: 1db1cb028db5f8af3a5bd5c264991791ae55f5f8

URL: https://github.com/llvm/llvm-project/commit/1db1cb028db5f8af3a5bd5c264991791ae55f5f8
DIFF: https://github.com/llvm/llvm-project/commit/1db1cb028db5f8af3a5bd5c264991791ae55f5f8.diff

LOG: [CMake] Add new cmake option to control adding comments in GenDAGISel

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

Added: 
    

Modified: 
    llvm/CMakeLists.txt
    llvm/cmake/modules/TableGen.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 78c3b4cf1a448..e0538dfd780f8 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -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()

diff  --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake
index 442b000e8a2a6..6d6513c5ab459 100644
--- a/llvm/cmake/modules/TableGen.cmake
+++ b/llvm/cmake/modules/TableGen.cmake
@@ -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")


        


More information about the llvm-commits mailing list