[llvm] 32b91ec - [cmake] Fix `-fno-lifetime-dse` not being passed to GCC

Vlad Serebrennikov via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 02:00:30 PDT 2024


Author: Vlad Serebrennikov
Date: 2024-05-30T12:00:24+03:00
New Revision: 32b91ec395529ef7ad8b5520fe692464f7512b41

URL: https://github.com/llvm/llvm-project/commit/32b91ec395529ef7ad8b5520fe692464f7512b41
DIFF: https://github.com/llvm/llvm-project/commit/32b91ec395529ef7ad8b5520fe692464f7512b41.diff

LOG: [cmake] Fix `-fno-lifetime-dse` not being passed to GCC

A follow-up to #92953. This should fix unexpected performance gains when Clang is built with GCC, and fix downstream LTO crashes reported in https://github.com/llvm/llvm-project/commit/4feae05c6abda364a9295aecfa600d7d4e7dfeb6#r142466703

Added: 
    

Modified: 
    llvm/cmake/modules/HandleLLVMOptions.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 99d848ba3d853..5ca580fbb59c5 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -672,7 +672,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
   append("-Werror=unguarded-availability-new" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
 endif()
 
-if (CMAKE_CXX_COMPILER_ID STREQUAL "GCC")
+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
   # LLVM data structures like llvm::User and llvm::MDNode rely on
   # the value of object storage persisting beyond the lifetime of the
   # object (#24952).  This is not standard compliant and causes a runtime


        


More information about the llvm-commits mailing list