[llvm-branch-commits] [lldb] 480643a - [CMake] Remove dead code setting policies to NEW
Author: Raul Tambre Date: 2021-01-19T17:19:36+02:00 New Revision: 480643a95cd157e654f4f97e8231b18850e7d79a URL: https://github.com/llvm/llvm-project/commit/480643a95cd157e654f4f97e8231b18850e7d79a DIFF: https://github.com/llvm/llvm-project/commit/480643a95cd157e654f4f97e8231b18850e7d79a.diff LOG: [CMake] Remove dead code setting policies to NEW cmake_minimum_required(VERSION) calls cmake_policy(VERSION), which sets all policies up to VERSION to NEW. LLVM started requiring CMake 3.13 last year, so we can remove a bunch of code setting policies prior to 3.13 to NEW as it no longer has any effect. Reviewed By: phosek, #libunwind, #libc, #libc_abi, ldionne Differential Revision: https://reviews.llvm.org/D94374 Added: Modified: clang/CMakeLists.txt compiler-rt/CMakeLists.txt flang/CMakeLists.txt libcxx/CMakeLists.txt libcxx/utils/ci/runtimes/CMakeLists.txt libcxxabi/CMakeLists.txt libunwind/CMakeLists.txt lldb/CMakeLists.txt llvm/CMakeLists.txt mlir/examples/standalone/CMakeLists.txt Removed: diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index f1e5a39cfe05..9e74014134a0 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -1,9 +1,5 @@ cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - # If we are not building as a part of LLVM, build Clang as an # standalone project, using LLVM as an external library: if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index 30302c2c1427..b44ad2c2118e 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -5,10 +5,6 @@ cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - # Check if compiler-rt is built as a standalone project. if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR COMPILER_RT_STANDALONE_BUILD) project(CompilerRT C CXX ASM) diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt index 07d34354bd81..79aa53830d5e 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -1,20 +1,6 @@ cmake_minimum_required(VERSION 3.13.4) -# RPATH settings on macOS do not affect INSTALL_NAME. -if (POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() - -# Include file check macros honor CMAKE_REQUIRED_LIBRARIES. -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - -# option() honors normal variables. -if (POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) option(LINK_WITH_FIR "Link driver with FIR and LLVM" ON) option(FLANG_BUILD_NEW_DRIVER "Build the flang compiler driver" OFF) diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index f4c7e9992f71..46a669500548 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -10,16 +10,7 @@ endif() #=== cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default -endif() -if(POLICY CMP0022) - cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang -endif() -if(POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) # Add path for custom modules set(CMAKE_MODULE_PATH diff --git a/libcxx/utils/ci/runtimes/CMakeLists.txt b/libcxx/utils/ci/runtimes/CMakeLists.txt index 20980b530d4d..ab4182ae949e 100644 --- a/libcxx/utils/ci/runtimes/CMakeLists.txt +++ b/libcxx/utils/ci/runtimes/CMakeLists.txt @@ -1,20 +1,8 @@ cmake_minimum_required(VERSION 3.13.4) - -if(POLICY CMP0068) - cmake_policy(SET CMP0068 NEW) - set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) -endif() - -if(POLICY CMP0075) - cmake_policy(SET CMP0075 NEW) -endif() - -if(POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() - project(LLVM_RUNTIMES) +set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) + find_package(Python3 COMPONENTS Interpreter) if(NOT Python3_Interpreter_FOUND) message(WARNING "Python3 not found, using python2 as a fallback") diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index 146749f57b0a..c8ab9d7acb1d 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -10,10 +10,6 @@ endif() cmake_minimum_required(VERSION 3.13.4) -if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default -endif() - # Add path for custom modules set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index e344263173b0..8ae32fbccf4e 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -8,10 +8,6 @@ endif() cmake_minimum_required(VERSION 3.13.4) -
[llvm-branch-commits] [llvm] 0ebc1fb - [CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath
Author: Raul Tambre Date: 2021-01-08T08:31:10+02:00 New Revision: 0ebc1fb29f278db0665423f15c53e6ee9601dddb URL: https://github.com/llvm/llvm-project/commit/0ebc1fb29f278db0665423f15c53e6ee9601dddb DIFF: https://github.com/llvm/llvm-project/commit/0ebc1fb29f278db0665423f15c53e6ee9601dddb.diff LOG: [CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath When `BUILD_WITH_INSTALL_RPATH` is enabled it prevents using a custom rpath only for the build tree as the install rpath will be used. This makes it impossible to run a runtimes build when compiling with Clang and wanting the installed rpath to be empty (i.e. `-DCMAKE_BUILD_RPATH="" -DCMAKE_SKIP_INSTALL_RPATH=ON`). Disable `BUILD_WITH_INSTALL_RPATH` when `CMAKE_BUILD_RPATH` is non-empty to allow for such build scenarios. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D93177 Added: Modified: llvm/cmake/modules/AddLLVM.cmake Removed: diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index b86fbdaaa6d8..dc06ea14c584 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -865,10 +865,13 @@ macro(add_llvm_executable name) if(NOT ARG_NO_INSTALL_RPATH) llvm_setup_rpath(${name}) - elseif (LLVM_LOCAL_RPATH) -set_target_properties(${name} PROPERTIES - BUILD_WITH_INSTALL_RPATH On - INSTALL_RPATH "${LLVM_LOCAL_RPATH}") + else() +# Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. +if(NOT "${CMAKE_BUILD_RPATH}" STREQUAL "") + set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) +endif() + +set_property(TARGET ${name} PROPERTY INSTALL_RPATH "${LLVM_LOCAL_RPATH}") endif() if(DEFINED windows_resource_file) @@ -2113,8 +2116,12 @@ function(llvm_setup_rpath name) return() endif() + # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. + if(NOT "${CMAKE_BUILD_RPATH}" STREQUAL "") +set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) + endif() + set_target_properties(${name} PROPERTIES -BUILD_WITH_INSTALL_RPATH On INSTALL_RPATH "${_install_rpath}" ${_install_name_dir}) endfunction() ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] 913c430 - Revert "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath"
Author: Raul Tambre Date: 2021-01-08T19:59:20+02:00 New Revision: 913c430403b52b9336ed93fabbac363a3e18536a URL: https://github.com/llvm/llvm-project/commit/913c430403b52b9336ed93fabbac363a3e18536a DIFF: https://github.com/llvm/llvm-project/commit/913c430403b52b9336ed93fabbac363a3e18536a.diff LOG: Revert "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath" This reverts commit 0ebc1fb29f278db0665423f15c53e6ee9601dddb. The behaviour should have been the same as before unless specifying CMAKE_BUILD_RPATH, which was previously broken. However, this seems to have broken builds for some people that don't specify it. Reverting until I can investigate. Differential Revision: https://reviews.llvm.org/D94319 Added: Modified: llvm/cmake/modules/AddLLVM.cmake Removed: diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index dc06ea14c584..b86fbdaaa6d8 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -865,13 +865,10 @@ macro(add_llvm_executable name) if(NOT ARG_NO_INSTALL_RPATH) llvm_setup_rpath(${name}) - else() -# Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. -if(NOT "${CMAKE_BUILD_RPATH}" STREQUAL "") - set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) -endif() - -set_property(TARGET ${name} PROPERTY INSTALL_RPATH "${LLVM_LOCAL_RPATH}") + elseif (LLVM_LOCAL_RPATH) +set_target_properties(${name} PROPERTIES + BUILD_WITH_INSTALL_RPATH On + INSTALL_RPATH "${LLVM_LOCAL_RPATH}") endif() if(DEFINED windows_resource_file) @@ -2116,12 +2113,8 @@ function(llvm_setup_rpath name) return() endif() - # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. - if(NOT "${CMAKE_BUILD_RPATH}" STREQUAL "") -set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) - endif() - set_target_properties(${name} PROPERTIES +BUILD_WITH_INSTALL_RPATH On INSTALL_RPATH "${_install_rpath}" ${_install_name_dir}) endfunction() ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] d9ce31a - Re-land "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath"
Author: Raul Tambre Date: 2021-01-08T20:26:08+02:00 New Revision: d9ce31ae7d1fc68de0ea1535fd25ef84e69aeb07 URL: https://github.com/llvm/llvm-project/commit/d9ce31ae7d1fc68de0ea1535fd25ef84e69aeb07 DIFF: https://github.com/llvm/llvm-project/commit/d9ce31ae7d1fc68de0ea1535fd25ef84e69aeb07.diff LOG: Re-land "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath" Reverted check for empty CMAKE_BUILD_RPATH fixed. When `BUILD_WITH_INSTALL_RPATH` is enabled it prevents using a custom rpath only for the build tree as the install rpath will be used. This makes it impossible to run a runtimes build when compiling with Clang and wanting the installed rpath to be empty (i.e. `-DCMAKE_BUILD_RPATH="" -DCMAKE_SKIP_INSTALL_RPATH=ON`). Disable `BUILD_WITH_INSTALL_RPATH` when `CMAKE_BUILD_RPATH` is non-empty to allow for such build scenarios. Differential Revision: https://reviews.llvm.org/D94322 Added: Modified: llvm/cmake/modules/AddLLVM.cmake Removed: diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index b86fbdaaa6d8..17b3ad381ea6 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -865,10 +865,13 @@ macro(add_llvm_executable name) if(NOT ARG_NO_INSTALL_RPATH) llvm_setup_rpath(${name}) - elseif (LLVM_LOCAL_RPATH) -set_target_properties(${name} PROPERTIES - BUILD_WITH_INSTALL_RPATH On - INSTALL_RPATH "${LLVM_LOCAL_RPATH}") + else() +# Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. +if("${CMAKE_BUILD_RPATH}" STREQUAL "") + set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) +endif() + +set_property(TARGET ${name} PROPERTY INSTALL_RPATH "${LLVM_LOCAL_RPATH}") endif() if(DEFINED windows_resource_file) @@ -2113,8 +2116,12 @@ function(llvm_setup_rpath name) return() endif() + # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. + if("${CMAKE_BUILD_RPATH}" STREQUAL "") +set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) + endif() + set_target_properties(${name} PROPERTIES -BUILD_WITH_INSTALL_RPATH On INSTALL_RPATH "${_install_rpath}" ${_install_name_dir}) endfunction() ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] 840a2c9 - [CMake] Fix incorrect rpath for tests if LLVM_LOCAL_RPATH isn't set
Author: Raul Tambre Date: 2021-01-08T21:24:18+02:00 New Revision: 840a2c978374ccc74a0e0b2576c1027fdb609a59 URL: https://github.com/llvm/llvm-project/commit/840a2c978374ccc74a0e0b2576c1027fdb609a59 DIFF: https://github.com/llvm/llvm-project/commit/840a2c978374ccc74a0e0b2576c1027fdb609a59.diff LOG: [CMake] Fix incorrect rpath for tests if LLVM_LOCAL_RPATH isn't set d9ce31ae7d (D94322) removed the check because I thought it was dead due to checking the existance of a variable (which always existed). This causes LLDB tests to fail as they set NO_INSTALL_RPATH because they're never meant to be installed, but we still would end up using the install rpath. Add the check back and make it explicitly check for an empty value to make the purpose clearer and avoid implicit test for a false/true value. Differential Revision: https://reviews.llvm.org/D94326 Added: Modified: llvm/cmake/modules/AddLLVM.cmake Removed: diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 17b3ad381ea6..97c9980c7de3 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -865,7 +865,7 @@ macro(add_llvm_executable name) if(NOT ARG_NO_INSTALL_RPATH) llvm_setup_rpath(${name}) - else() + elseif(NOT "${LLVM_LOCAL_RPATH}" STREQUAL "") # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. if("${CMAKE_BUILD_RPATH}" STREQUAL "") set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] 3000c19 - [Compiler-rt][AArch64] Workaround for .cfi_startproc assembler parser bug.
Author: Raul Tambre Date: 2020-12-15T08:14:42+02:00 New Revision: 3000c19df64f89ff319590f3a6e4d6b93d20983d URL: https://github.com/llvm/llvm-project/commit/3000c19df64f89ff319590f3a6e4d6b93d20983d DIFF: https://github.com/llvm/llvm-project/commit/3000c19df64f89ff319590f3a6e4d6b93d20983d.diff LOG: [Compiler-rt][AArch64] Workaround for .cfi_startproc assembler parser bug. Put .cfi_startproc on a new line to avoid hitting the assembly parser bug in MasmParser::parseDirectiveCFIStartProc(). Reviewed By: tambre Differential Revision: https://reviews.llvm.org/D93236 Added: Modified: compiler-rt/lib/builtins/aarch64/lse.S compiler-rt/lib/builtins/assembly.h Removed: diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S index 770f098b7cf1..e1c801cd62fc 100644 --- a/compiler-rt/lib/builtins/aarch64/lse.S +++ b/compiler-rt/lib/builtins/aarch64/lse.S @@ -113,7 +113,8 @@ HIDDEN(__aarch64_have_lse_atomics) .endm #ifdef L_cas -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(cas)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(NAME(cas)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(NAME(cas)) JUMP_IF_NOT_LSE 8f #if SIZE < 16 #ifdef HAS_ASM_LSE @@ -166,7 +167,8 @@ END_COMPILERRT_OUTLINE_FUNCTION(NAME(cas)) #else #define SWP .inst 0x38208020 + B + N #endif -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(swp)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(NAME(swp)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(NAME(swp)) JUMP_IF_NOT_LSE 8f SWP// s(0), s(0), [x1] ret @@ -209,7 +211,8 @@ END_COMPILERRT_OUTLINE_FUNCTION(NAME(swp)) #define LDOP .inst 0x38200020 + OPN + B + N #endif -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(LDNM)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(NAME(LDNM)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(NAME(LDNM)) JUMP_IF_NOT_LSE 8f LDOP // s(0), s(0), [x1] ret diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h index 66625a926cd0..3b00a5def6f3 100644 --- a/compiler-rt/lib/builtins/assembly.h +++ b/compiler-rt/lib/builtins/assembly.h @@ -243,12 +243,16 @@ DECLARE_FUNC_ENCODING \ name: -#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(name) \ +// TODO(ilinpv) START & END parts will be merged when assembly parser bug +// (kristina) in MasmParser::parseDirectiveCFIStartProc() is fixed. +#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(name) \ DEFINE_CODE_STATE \ FUNC_ALIGN \ .globl name SEPARATOR \ SYMBOL_IS_FUNC(name) SEPARATOR \ - DECLARE_SYMBOL_VISIBILITY(name) SEPARATOR \ + DECLARE_SYMBOL_VISIBILITY(name) + +#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(name) \ CFI_START SEPARATOR \ DECLARE_FUNC_ENCODING \ name: SEPARATOR BTI_C ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] a72d462 - Re-apply "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately"
Author: Raul Tambre Date: 2020-12-15T08:18:07+02:00 New Revision: a72d462eb9b9f5698e081c8ccf3bc7fa3e35da08 URL: https://github.com/llvm/llvm-project/commit/a72d462eb9b9f5698e081c8ccf3bc7fa3e35da08 DIFF: https://github.com/llvm/llvm-project/commit/a72d462eb9b9f5698e081c8ccf3bc7fa3e35da08.diff LOG: Re-apply "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately" aa772fc85e0f526615c78b9c3979c2be945a754c (D92530) has landed fixing relocations on Darwin. 3000c19df64f89ff319590f3a6e4d6b93d20983d (D93236) has landed working around an assembly parser bug on Darwin. Previous quick-fix d9697c2e6b153ac7dc40a69450d9b672f71b1029 (D93198) included in this commit. Invoking the preprocessor ourselves is fragile and would require us to replicate CMake's handling of definitions, compiler flags, etc for proper compatibility. In my toolchain builds this notably resulted in a bunch of warnings from unused flags as my CMAKE_C_FLAGS includes CPU-specific optimization options. Notably this part was already duplicating the logic for VISIBILITY_HIDDEN define. Instead, symlink the files and set the proper set of defines on each. This should also be faster as we avoid invoking the compiler multiple times. Fixes https://llvm.org/PR48494 Differential Revision: https://reviews.llvm.org/D93278 Added: Modified: compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake compiler-rt/lib/builtins/CMakeLists.txt compiler-rt/lib/builtins/aarch64/lse.S Removed: diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake index f6689c2e79ad..456a8dcda59f 100644 --- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -395,7 +395,9 @@ macro(darwin_add_builtin_libraries) set(CMAKE_CXX_FLAGS "") set(CMAKE_ASM_FLAGS "") - set(PROFILE_SOURCES ../profile/InstrProfiling + append_string_if(COMPILER_RT_HAS_ASM_LSE " -DHAS_ASM_LSE" CFLAGS) + + set(PROFILE_SOURCES ../profile/InstrProfiling ../profile/InstrProfilingBuffer ../profile/InstrProfilingPlatformDarwin ../profile/InstrProfilingWriter diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index d84f4d09e53e..5259e951dff3 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -509,31 +509,24 @@ set(aarch64_SOURCES ) # Generate outline atomics helpers from lse.S base -set(CUSTOM_FLAGS ${CMAKE_C_FLAGS}) -if(NOT ANDROID) - append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG -DVISIBILITY_HIDDEN CUSTOM_FLAGS) -endif() -append_list_if(COMPILER_RT_HAS_ASM_LSE -DHAS_ASM_LSE CUSTOM_FLAGS) -string(REPLACE " " "\t" CUSTOM_FLAGS "${CUSTOM_FLAGS}") set(OA_HELPERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/outline_atomic_helpers.dir") -file(MAKE_DIRECTORY ${OA_HELPERS_DIR}) +file(MAKE_DIRECTORY "${OA_HELPERS_DIR}") foreach(pat cas swp ldadd ldclr ldeor ldset) foreach(size 1 2 4 8 16) foreach(model 1 2 3 4) if(pat STREQUAL "cas" OR NOT size STREQUAL "16") -set(helper_asm ${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S) +set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S") add_custom_command( OUTPUT ${helper_asm} - COMMAND ${CMAKE_C_COMPILER} -E ${CUSTOM_FLAGS} -DL_${pat} -DSIZE=${size} -DMODEL=${model} - ${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S -o ${helper_asm} - DEPENDS aarch64/lse.S assembly.h + COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}" ) -set_source_files_properties(${helper_asm} PROPERTIES GENERATED TRUE) -set(aarch64_SOURCES - ${aarch64_SOURCES} - ${helper_asm} +set_source_files_properties("${helper_asm}" + PROPERTIES + COMPILE_DEFINITIONS "L_${pat};SIZE=${size};MODEL=${model}" + INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" ) +list(APPEND aarch64_SOURCES "${helper_asm}") endif() endforeach(model) endforeach(size) @@ -687,6 +680,8 @@ else () append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG VISIBILITY_HIDDEN BUILTIN_DEFS) endif() + append_list_if(COMPILER_RT_HAS_ASM_LSE HAS_ASM_LSE BUILTIN_DEFS) + foreach (arch ${BUILTIN_SUPPORTED_ARCH}) if (CAN_TARGET_${arch}) # For ARM archs, exclude any VFP builtins if VFP is not supported diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S index e1c801cd62fc..87d8b3ac9be4 100644 --- a/compiler-rt/lib/builtins/aarch64/lse.S +++ b/compiler-rt/lib/builtins/aarch64/lse.S @@ -2,7 +2,7 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-Licens
[llvm-branch-commits] [llvm] 95bfd08 - [PGO] Allow overriding -vp-counters-per-site
Author: Raul Tambre Date: 2020-12-15T19:03:27+02:00 New Revision: 95bfd0849f7fb8d0fe2c5d971ed97c219e1ccf72 URL: https://github.com/llvm/llvm-project/commit/95bfd0849f7fb8d0fe2c5d971ed97c219e1ccf72 DIFF: https://github.com/llvm/llvm-project/commit/95bfd0849f7fb8d0fe2c5d971ed97c219e1ccf72.diff LOG: [PGO] Allow overriding -vp-counters-per-site In some build configurations more than 1.5 might be required. Paramaterize so it can be changed by the user. Reviewed By: yamauchi Differential Revision: https://reviews.llvm.org/D93281 Added: Modified: llvm/cmake/modules/HandleLLVMOptions.cmake Removed: diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index f313492ba978..5d4d692a70ac 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -904,7 +904,8 @@ option(LLVM_ENABLE_IR_PGO "Build LLVM and tools with IR PGO instrumentation (dep mark_as_advanced(LLVM_ENABLE_IR_PGO) set(LLVM_BUILD_INSTRUMENTED OFF CACHE STRING "Build LLVM and tools with PGO instrumentation. May be specified as IR or Frontend") -mark_as_advanced(LLVM_BUILD_INSTRUMENTED) +set(LLVM_VP_COUNTERS_PER_SITE "1.5" CACHE STRING "Value profile counters to use per site for IR PGO with Clang") +mark_as_advanced(LLVM_BUILD_INSTRUMENTED LLVM_VP_COUNTERS_PER_SITE) string(TOUPPER "${LLVM_BUILD_INSTRUMENTED}" uppercase_LLVM_BUILD_INSTRUMENTED) if (LLVM_BUILD_INSTRUMENTED) @@ -922,7 +923,7 @@ if (LLVM_BUILD_INSTRUMENTED) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND LLVM_LINK_LLVM_DYLIB) - append("-Xclang -mllvm -Xclang -vp-counters-per-site=1.5" + append("-Xclang -mllvm -Xclang -vp-counters-per-site=${LLVM_VP_COUNTERS_PER_SITE}" CMAKE_CXX_FLAGS CMAKE_C_FLAGS) endif() ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] b2851ae - Revert "[Compiler-rt][AArch64] Workaround for .cfi_startproc assembler parser bug."
Author: Raul Tambre Date: 2020-12-16T10:22:04+02:00 New Revision: b2851aea80e5a8f0cfd6c3c5a56a6b00fb28c6b6 URL: https://github.com/llvm/llvm-project/commit/b2851aea80e5a8f0cfd6c3c5a56a6b00fb28c6b6 DIFF: https://github.com/llvm/llvm-project/commit/b2851aea80e5a8f0cfd6c3c5a56a6b00fb28c6b6.diff LOG: Revert "[Compiler-rt][AArch64] Workaround for .cfi_startproc assembler parser bug." 039cb03dd0dcff4daa17a062f7414ac22bf5f2eb (D93378) fixed the assembly separator, so the workaround is no longer necessary. This reverts commit 3000c19df64f89ff319590f3a6e4d6b93d20983d. Differential Revision: https://reviews.llvm.org/D93379 Added: Modified: compiler-rt/lib/builtins/aarch64/lse.S compiler-rt/lib/builtins/assembly.h Removed: diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S index 87d8b3ac9be4..7a9433fd89cf 100644 --- a/compiler-rt/lib/builtins/aarch64/lse.S +++ b/compiler-rt/lib/builtins/aarch64/lse.S @@ -113,8 +113,7 @@ HIDDEN(__aarch64_have_lse_atomics) .endm #ifdef L_cas -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(NAME(cas)) -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(NAME(cas)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(cas)) JUMP_IF_NOT_LSE 8f #if SIZE < 16 #ifdef HAS_ASM_LSE @@ -167,8 +166,7 @@ END_COMPILERRT_OUTLINE_FUNCTION(NAME(cas)) #else #define SWP .inst 0x38208020 + B + N #endif -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(NAME(swp)) -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(NAME(swp)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(swp)) JUMP_IF_NOT_LSE 8f SWP// s(0), s(0), [x1] ret @@ -211,8 +209,7 @@ END_COMPILERRT_OUTLINE_FUNCTION(NAME(swp)) #define LDOP .inst 0x38200020 + OPN + B + N #endif -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(NAME(LDNM)) -DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(NAME(LDNM)) +DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(NAME(LDNM)) JUMP_IF_NOT_LSE 8f LDOP // s(0), s(0), [x1] ret diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h index 0f86c74a9ca2..f6ce6a9fccff 100644 --- a/compiler-rt/lib/builtins/assembly.h +++ b/compiler-rt/lib/builtins/assembly.h @@ -243,16 +243,12 @@ DECLARE_FUNC_ENCODING \ name: -// TODO(ilinpv) START & END parts will be merged when assembly parser bug -// (kristina) in MasmParser::parseDirectiveCFIStartProc() is fixed. -#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_START(name) \ +#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED(name) \ DEFINE_CODE_STATE \ FUNC_ALIGN \ .globl name SEPARATOR \ SYMBOL_IS_FUNC(name) SEPARATOR \ - DECLARE_SYMBOL_VISIBILITY(name) - -#define DEFINE_COMPILERRT_OUTLINE_FUNCTION_UNMANGLED_END(name) \ + DECLARE_SYMBOL_VISIBILITY(name) SEPARATOR \ CFI_START SEPARATOR \ DECLARE_FUNC_ENCODING \ name: SEPARATOR BTI_C ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] 33b740f - [CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately
Author: Raul Tambre Date: 2020-12-14T09:20:30+02:00 New Revision: 33b740f8dc3496237619a7bc6722f23655cb1f94 URL: https://github.com/llvm/llvm-project/commit/33b740f8dc3496237619a7bc6722f23655cb1f94 DIFF: https://github.com/llvm/llvm-project/commit/33b740f8dc3496237619a7bc6722f23655cb1f94.diff LOG: [CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately Invoking the preprocessor ourselves is fragile and would require us to replicate CMake's handling of definitions, compiler flags, etc for proper compatibility. In my toolchain builds this notably resulted in a bunch of warnings from unused flags as my CMAKE_C_FLAGS includes CPU-specific optimization options. Notably this part was already duplicating the logic for VISIBILITY_HIDDEN define. Instead, symlink the files and set the proper set of defines on each. This should also be faster as we avoid invoking the compiler multiple times. Fixes https://llvm.org/PR48494 Reviewed By: ilinpv Differential Revision: https://reviews.llvm.org/D93178 Added: Modified: compiler-rt/lib/builtins/CMakeLists.txt compiler-rt/lib/builtins/aarch64/lse.S Removed: diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index d84f4d09e53e..5259e951dff3 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -509,31 +509,24 @@ set(aarch64_SOURCES ) # Generate outline atomics helpers from lse.S base -set(CUSTOM_FLAGS ${CMAKE_C_FLAGS}) -if(NOT ANDROID) - append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG -DVISIBILITY_HIDDEN CUSTOM_FLAGS) -endif() -append_list_if(COMPILER_RT_HAS_ASM_LSE -DHAS_ASM_LSE CUSTOM_FLAGS) -string(REPLACE " " "\t" CUSTOM_FLAGS "${CUSTOM_FLAGS}") set(OA_HELPERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/outline_atomic_helpers.dir") -file(MAKE_DIRECTORY ${OA_HELPERS_DIR}) +file(MAKE_DIRECTORY "${OA_HELPERS_DIR}") foreach(pat cas swp ldadd ldclr ldeor ldset) foreach(size 1 2 4 8 16) foreach(model 1 2 3 4) if(pat STREQUAL "cas" OR NOT size STREQUAL "16") -set(helper_asm ${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S) +set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S") add_custom_command( OUTPUT ${helper_asm} - COMMAND ${CMAKE_C_COMPILER} -E ${CUSTOM_FLAGS} -DL_${pat} -DSIZE=${size} -DMODEL=${model} - ${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S -o ${helper_asm} - DEPENDS aarch64/lse.S assembly.h + COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}" ) -set_source_files_properties(${helper_asm} PROPERTIES GENERATED TRUE) -set(aarch64_SOURCES - ${aarch64_SOURCES} - ${helper_asm} +set_source_files_properties("${helper_asm}" + PROPERTIES + COMPILE_DEFINITIONS "L_${pat};SIZE=${size};MODEL=${model}" + INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" ) +list(APPEND aarch64_SOURCES "${helper_asm}") endif() endforeach(model) endforeach(size) @@ -687,6 +680,8 @@ else () append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG VISIBILITY_HIDDEN BUILTIN_DEFS) endif() + append_list_if(COMPILER_RT_HAS_ASM_LSE HAS_ASM_LSE BUILTIN_DEFS) + foreach (arch ${BUILTIN_SUPPORTED_ARCH}) if (CAN_TARGET_${arch}) # For ARM archs, exclude any VFP builtins if VFP is not supported diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S index 4c75fa524c44..f030d5ddc1c5 100644 --- a/compiler-rt/lib/builtins/aarch64/lse.S +++ b/compiler-rt/lib/builtins/aarch64/lse.S @@ -2,7 +2,7 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "../assembly.h" +#include "assembly.h" // Out-of-line LSE atomics helpers. Ported from libgcc library. // N = {1, 2, 4, 8} ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] d9697c2 - [compiler-rt][CMake] Define HAS_ASM_LSE on Apple if available
Author: Raul Tambre Date: 2020-12-14T11:26:24+02:00 New Revision: d9697c2e6b153ac7dc40a69450d9b672f71b1029 URL: https://github.com/llvm/llvm-project/commit/d9697c2e6b153ac7dc40a69450d9b672f71b1029 DIFF: https://github.com/llvm/llvm-project/commit/d9697c2e6b153ac7dc40a69450d9b672f71b1029.diff LOG: [compiler-rt][CMake] Define HAS_ASM_LSE on Apple if available Should hopefully fix 33b740f8dc3496237619a7bc6722f23655cb1f94 (D93178) failing on bots. Differential Revision: https://reviews.llvm.org/D93198 Added: Modified: compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake Removed: diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake index f6689c2e79ad..456a8dcda59f 100644 --- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -395,7 +395,9 @@ macro(darwin_add_builtin_libraries) set(CMAKE_CXX_FLAGS "") set(CMAKE_ASM_FLAGS "") - set(PROFILE_SOURCES ../profile/InstrProfiling + append_string_if(COMPILER_RT_HAS_ASM_LSE " -DHAS_ASM_LSE" CFLAGS) + + set(PROFILE_SOURCES ../profile/InstrProfiling ../profile/InstrProfilingBuffer ../profile/InstrProfilingPlatformDarwin ../profile/InstrProfilingWriter ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] 617cd01 - Revert "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately"
Author: Raul Tambre Date: 2020-12-14T11:42:28+02:00 New Revision: 617cd01a4b7abcb4be9dc0139bf3ed03f241608a URL: https://github.com/llvm/llvm-project/commit/617cd01a4b7abcb4be9dc0139bf3ed03f241608a DIFF: https://github.com/llvm/llvm-project/commit/617cd01a4b7abcb4be9dc0139bf3ed03f241608a.diff LOG: Revert "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately" Causing issues on Apple buildbots. http://green.lab.llvm.org/green/job/clang-stage1-RA/17019/console This reverts commit 33b740f8dc3496237619a7bc6722f23655cb1f94. This reverts commit d9697c2e6b153ac7dc40a69450d9b672f71b1029. Differential Revision: https://reviews.llvm.org/D93199 Added: Modified: compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake compiler-rt/lib/builtins/CMakeLists.txt compiler-rt/lib/builtins/aarch64/lse.S Removed: diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake index 456a8dcda59f..f6689c2e79ad 100644 --- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -395,9 +395,7 @@ macro(darwin_add_builtin_libraries) set(CMAKE_CXX_FLAGS "") set(CMAKE_ASM_FLAGS "") - append_string_if(COMPILER_RT_HAS_ASM_LSE " -DHAS_ASM_LSE" CFLAGS) - - set(PROFILE_SOURCES ../profile/InstrProfiling + set(PROFILE_SOURCES ../profile/InstrProfiling ../profile/InstrProfilingBuffer ../profile/InstrProfilingPlatformDarwin ../profile/InstrProfilingWriter diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index 5259e951dff3..d84f4d09e53e 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -509,24 +509,31 @@ set(aarch64_SOURCES ) # Generate outline atomics helpers from lse.S base +set(CUSTOM_FLAGS ${CMAKE_C_FLAGS}) +if(NOT ANDROID) + append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG -DVISIBILITY_HIDDEN CUSTOM_FLAGS) +endif() +append_list_if(COMPILER_RT_HAS_ASM_LSE -DHAS_ASM_LSE CUSTOM_FLAGS) +string(REPLACE " " "\t" CUSTOM_FLAGS "${CUSTOM_FLAGS}") set(OA_HELPERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/outline_atomic_helpers.dir") -file(MAKE_DIRECTORY "${OA_HELPERS_DIR}") +file(MAKE_DIRECTORY ${OA_HELPERS_DIR}) foreach(pat cas swp ldadd ldclr ldeor ldset) foreach(size 1 2 4 8 16) foreach(model 1 2 3 4) if(pat STREQUAL "cas" OR NOT size STREQUAL "16") -set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S") +set(helper_asm ${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S) add_custom_command( OUTPUT ${helper_asm} - COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}" + COMMAND ${CMAKE_C_COMPILER} -E ${CUSTOM_FLAGS} -DL_${pat} -DSIZE=${size} -DMODEL=${model} + ${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S -o ${helper_asm} + DEPENDS aarch64/lse.S assembly.h ) -set_source_files_properties("${helper_asm}" - PROPERTIES - COMPILE_DEFINITIONS "L_${pat};SIZE=${size};MODEL=${model}" - INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" +set_source_files_properties(${helper_asm} PROPERTIES GENERATED TRUE) +set(aarch64_SOURCES + ${aarch64_SOURCES} + ${helper_asm} ) -list(APPEND aarch64_SOURCES "${helper_asm}") endif() endforeach(model) endforeach(size) @@ -680,8 +687,6 @@ else () append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG VISIBILITY_HIDDEN BUILTIN_DEFS) endif() - append_list_if(COMPILER_RT_HAS_ASM_LSE HAS_ASM_LSE BUILTIN_DEFS) - foreach (arch ${BUILTIN_SUPPORTED_ARCH}) if (CAN_TARGET_${arch}) # For ARM archs, exclude any VFP builtins if VFP is not supported diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S index f030d5ddc1c5..4c75fa524c44 100644 --- a/compiler-rt/lib/builtins/aarch64/lse.S +++ b/compiler-rt/lib/builtins/aarch64/lse.S @@ -2,7 +2,7 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "assembly.h" +#include "../assembly.h" // Out-of-line LSE atomics helpers. Ported from libgcc library. // N = {1, 2, 4, 8} ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] 55f07a3 - [XRay] Remove unnecessary include
Author: Raul Tambre Date: 2020-12-14T12:36:35+02:00 New Revision: 55f07a340070ebfb53eef68a624956d11936b1fe URL: https://github.com/llvm/llvm-project/commit/55f07a340070ebfb53eef68a624956d11936b1fe DIFF: https://github.com/llvm/llvm-project/commit/55f07a340070ebfb53eef68a624956d11936b1fe.diff LOG: [XRay] Remove unnecessary include It hasn't been necessary since commit 4d4ed0e288bf1f3a90fba6e5b56bc25e2fe961c3 (D43278). Reviewed By: dberris Differential Revision: https://reviews.llvm.org/D93196 Added: Modified: compiler-rt/lib/xray/xray_x86_64.inc Removed: diff --git a/compiler-rt/lib/xray/xray_x86_64.inc b/compiler-rt/lib/xray/xray_x86_64.inc index 477900355cf4..dc71fb87f63d 100644 --- a/compiler-rt/lib/xray/xray_x86_64.inc +++ b/compiler-rt/lib/xray/xray_x86_64.inc @@ -11,7 +11,6 @@ //===--===// #include -#include #include "sanitizer_common/sanitizer_internal_defs.h" #include "xray_defs.h" ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] aa772fc - [compiler-rt] [builtins] Make lse.S compile on Darwin
Author: Kuba Mracek Date: 2020-12-14T16:38:48+02:00 New Revision: aa772fc85e0f526615c78b9c3979c2be945a754c URL: https://github.com/llvm/llvm-project/commit/aa772fc85e0f526615c78b9c3979c2be945a754c DIFF: https://github.com/llvm/llvm-project/commit/aa772fc85e0f526615c78b9c3979c2be945a754c.diff LOG: [compiler-rt] [builtins] Make lse.S compile on Darwin Reviewed By: ilinpv Differential Revision: https://reviews.llvm.org/D92530 Added: Modified: compiler-rt/lib/builtins/aarch64/lse.S Removed: diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S index 4c75fa524c44..770f098b7cf1 100644 --- a/compiler-rt/lib/builtins/aarch64/lse.S +++ b/compiler-rt/lib/builtins/aarch64/lse.S @@ -102,8 +102,13 @@ HIDDEN(__aarch64_have_lse_atomics) // Macro for branch to label if no LSE available .macro JUMP_IF_NOT_LSE label +#if !defined(__APPLE__) adrpx(tmp0), __aarch64_have_lse_atomics ldrbw(tmp0), [x(tmp0), :lo12:__aarch64_have_lse_atomics] +#else +adrpx(tmp0), __aarch64_have_lse_atomics@page +ldrbw(tmp0), [x(tmp0), __aarch64_have_lse_atomics@pageoff] +#endif cbz w(tmp0), \label .endm ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] d0797e6 - Re-apply "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately"
Author: Raul Tambre Date: 2020-12-14T16:45:48+02:00 New Revision: d0797e62fa8a73ad75dcaca7c0e1a71c2001c855 URL: https://github.com/llvm/llvm-project/commit/d0797e62fa8a73ad75dcaca7c0e1a71c2001c855 DIFF: https://github.com/llvm/llvm-project/commit/d0797e62fa8a73ad75dcaca7c0e1a71c2001c855.diff LOG: Re-apply "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately" aa772fc85e0f526615c78b9c3979c2be945a754c (D92530) has landed fixing Apple builds. Previous quick-fix d9697c2e6b153ac7dc40a69450d9b672f71b1029 (D93198) included in this commit. Invoking the preprocessor ourselves is fragile and would require us to replicate CMake's handling of definitions, compiler flags, etc for proper compatibility. In my toolchain builds this notably resulted in a bunch of warnings from unused flags as my CMAKE_C_FLAGS includes CPU-specific optimization options. Notably this part was already duplicating the logic for VISIBILITY_HIDDEN define. Instead, symlink the files and set the proper set of defines on each. This should also be faster as we avoid invoking the compiler multiple times. Fixes https://llvm.org/PR48494 Differential Revision: https://reviews.llvm.org/D93211 Added: Modified: compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake compiler-rt/lib/builtins/CMakeLists.txt compiler-rt/lib/builtins/aarch64/lse.S Removed: diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake index f6689c2e79ad..456a8dcda59f 100644 --- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -395,7 +395,9 @@ macro(darwin_add_builtin_libraries) set(CMAKE_CXX_FLAGS "") set(CMAKE_ASM_FLAGS "") - set(PROFILE_SOURCES ../profile/InstrProfiling + append_string_if(COMPILER_RT_HAS_ASM_LSE " -DHAS_ASM_LSE" CFLAGS) + + set(PROFILE_SOURCES ../profile/InstrProfiling ../profile/InstrProfilingBuffer ../profile/InstrProfilingPlatformDarwin ../profile/InstrProfilingWriter diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index d84f4d09e53e..5259e951dff3 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -509,31 +509,24 @@ set(aarch64_SOURCES ) # Generate outline atomics helpers from lse.S base -set(CUSTOM_FLAGS ${CMAKE_C_FLAGS}) -if(NOT ANDROID) - append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG -DVISIBILITY_HIDDEN CUSTOM_FLAGS) -endif() -append_list_if(COMPILER_RT_HAS_ASM_LSE -DHAS_ASM_LSE CUSTOM_FLAGS) -string(REPLACE " " "\t" CUSTOM_FLAGS "${CUSTOM_FLAGS}") set(OA_HELPERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/outline_atomic_helpers.dir") -file(MAKE_DIRECTORY ${OA_HELPERS_DIR}) +file(MAKE_DIRECTORY "${OA_HELPERS_DIR}") foreach(pat cas swp ldadd ldclr ldeor ldset) foreach(size 1 2 4 8 16) foreach(model 1 2 3 4) if(pat STREQUAL "cas" OR NOT size STREQUAL "16") -set(helper_asm ${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S) +set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S") add_custom_command( OUTPUT ${helper_asm} - COMMAND ${CMAKE_C_COMPILER} -E ${CUSTOM_FLAGS} -DL_${pat} -DSIZE=${size} -DMODEL=${model} - ${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S -o ${helper_asm} - DEPENDS aarch64/lse.S assembly.h + COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}" ) -set_source_files_properties(${helper_asm} PROPERTIES GENERATED TRUE) -set(aarch64_SOURCES - ${aarch64_SOURCES} - ${helper_asm} +set_source_files_properties("${helper_asm}" + PROPERTIES + COMPILE_DEFINITIONS "L_${pat};SIZE=${size};MODEL=${model}" + INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" ) +list(APPEND aarch64_SOURCES "${helper_asm}") endif() endforeach(model) endforeach(size) @@ -687,6 +680,8 @@ else () append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG VISIBILITY_HIDDEN BUILTIN_DEFS) endif() + append_list_if(COMPILER_RT_HAS_ASM_LSE HAS_ASM_LSE BUILTIN_DEFS) + foreach (arch ${BUILTIN_SUPPORTED_ARCH}) if (CAN_TARGET_${arch}) # For ARM archs, exclude any VFP builtins if VFP is not supported diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S index 770f098b7cf1..7a9433fd89cf 100644 --- a/compiler-rt/lib/builtins/aarch64/lse.S +++ b/compiler-rt/lib/builtins/aarch64/lse.S @@ -2,7 +2,7 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "../assembly.h" +#include "assembly.h" // Out-of-line LSE at
[llvm-branch-commits] [compiler-rt] c21df2a - Revert "Re-apply "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately""
Author: Raul Tambre Date: 2020-12-14T18:43:55+02:00 New Revision: c21df2a79c268d1e0f467ec25a1ec7cb4aff5dfb URL: https://github.com/llvm/llvm-project/commit/c21df2a79c268d1e0f467ec25a1ec7cb4aff5dfb DIFF: https://github.com/llvm/llvm-project/commit/c21df2a79c268d1e0f467ec25a1ec7cb4aff5dfb.diff LOG: Revert "Re-apply "[CMake][compiler-rt][AArch64] Avoid preprocessing LSE builtins separately"" This reverts commit 03ebe1937192c247c4a7b8ec19dde2cf9845c914. It's still breaking bots, e.g. http://green.lab.llvm.org/green/job/clang-stage1-RA/17027/console although it doesn't change any actual code. The compile errors don't make much sense either. Revert for now. Differential Revision: https://reviews.llvm.org/D93228 Added: Modified: compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake compiler-rt/lib/builtins/CMakeLists.txt compiler-rt/lib/builtins/aarch64/lse.S Removed: diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake index 456a8dcda59f..f6689c2e79ad 100644 --- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -395,9 +395,7 @@ macro(darwin_add_builtin_libraries) set(CMAKE_CXX_FLAGS "") set(CMAKE_ASM_FLAGS "") - append_string_if(COMPILER_RT_HAS_ASM_LSE " -DHAS_ASM_LSE" CFLAGS) - - set(PROFILE_SOURCES ../profile/InstrProfiling + set(PROFILE_SOURCES ../profile/InstrProfiling ../profile/InstrProfilingBuffer ../profile/InstrProfilingPlatformDarwin ../profile/InstrProfilingWriter diff --git a/compiler-rt/lib/builtins/CMakeLists.txt b/compiler-rt/lib/builtins/CMakeLists.txt index 5259e951dff3..d84f4d09e53e 100644 --- a/compiler-rt/lib/builtins/CMakeLists.txt +++ b/compiler-rt/lib/builtins/CMakeLists.txt @@ -509,24 +509,31 @@ set(aarch64_SOURCES ) # Generate outline atomics helpers from lse.S base +set(CUSTOM_FLAGS ${CMAKE_C_FLAGS}) +if(NOT ANDROID) + append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG -DVISIBILITY_HIDDEN CUSTOM_FLAGS) +endif() +append_list_if(COMPILER_RT_HAS_ASM_LSE -DHAS_ASM_LSE CUSTOM_FLAGS) +string(REPLACE " " "\t" CUSTOM_FLAGS "${CUSTOM_FLAGS}") set(OA_HELPERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/outline_atomic_helpers.dir") -file(MAKE_DIRECTORY "${OA_HELPERS_DIR}") +file(MAKE_DIRECTORY ${OA_HELPERS_DIR}) foreach(pat cas swp ldadd ldclr ldeor ldset) foreach(size 1 2 4 8 16) foreach(model 1 2 3 4) if(pat STREQUAL "cas" OR NOT size STREQUAL "16") -set(helper_asm "${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S") +set(helper_asm ${OA_HELPERS_DIR}/outline_atomic_${pat}${size}_${model}.S) add_custom_command( OUTPUT ${helper_asm} - COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S" "${helper_asm}" + COMMAND ${CMAKE_C_COMPILER} -E ${CUSTOM_FLAGS} -DL_${pat} -DSIZE=${size} -DMODEL=${model} + ${CMAKE_CURRENT_SOURCE_DIR}/aarch64/lse.S -o ${helper_asm} + DEPENDS aarch64/lse.S assembly.h ) -set_source_files_properties("${helper_asm}" - PROPERTIES - COMPILE_DEFINITIONS "L_${pat};SIZE=${size};MODEL=${model}" - INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" +set_source_files_properties(${helper_asm} PROPERTIES GENERATED TRUE) +set(aarch64_SOURCES + ${aarch64_SOURCES} + ${helper_asm} ) -list(APPEND aarch64_SOURCES "${helper_asm}") endif() endforeach(model) endforeach(size) @@ -680,8 +687,6 @@ else () append_list_if(COMPILER_RT_HAS_VISIBILITY_HIDDEN_FLAG VISIBILITY_HIDDEN BUILTIN_DEFS) endif() - append_list_if(COMPILER_RT_HAS_ASM_LSE HAS_ASM_LSE BUILTIN_DEFS) - foreach (arch ${BUILTIN_SUPPORTED_ARCH}) if (CAN_TARGET_${arch}) # For ARM archs, exclude any VFP builtins if VFP is not supported diff --git a/compiler-rt/lib/builtins/aarch64/lse.S b/compiler-rt/lib/builtins/aarch64/lse.S index 7a9433fd89cf..770f098b7cf1 100644 --- a/compiler-rt/lib/builtins/aarch64/lse.S +++ b/compiler-rt/lib/builtins/aarch64/lse.S @@ -2,7 +2,7 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "assembly.h" +#include "../assembly.h" // Out-of-line LSE atomics helpers. Ported from libgcc library. // N = {1, 2, 4, 8} ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits