Skip to content

Commit

Permalink
Merge branch 'master' into least_greatest_string
Browse files Browse the repository at this point in the history
  • Loading branch information
ywqzzy authored Feb 7, 2023
2 parents 0e65d0d + 12b6901 commit 337b187
Show file tree
Hide file tree
Showing 379 changed files with 13,770 additions and 5,113 deletions.
1 change: 1 addition & 0 deletions .github/licenserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ header:
- '**/NOTICE'
- 'dbms/src/IO/tests/limit_read_buffer.reference'
- 'dbms/src/IO/tests/DevicePixelRatio'
- 'dbms/src/Flash/tests/gtest_*.out'
- 'Cargo.lock'
- 'Cargo.toml'
- 'rust-toolchain'
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/bug-closed.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/license-checker.yml

This file was deleted.

12 changes: 3 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,12 @@ if (USE_STATIC_LIBRARIES)
list(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
endif ()

if (CMAKE_LIBRARY_ARCHITECTURE MATCHES "amd64.*|x86_64.*|AMD64.*")
if (ARCH_AMD64)
option (USE_INTERNAL_MEMCPY "Use internal implementation of 'memcpy' function instead of provided by libc. Only for x86_64." ON)

if (OS_LINUX)
option (GLIBC_COMPATIBILITY "Set to TRUE to enable compatibility with older glibc libraries. Only for x86_64, Linux. Implies USE_INTERNAL_MEMCPY." ON)
endif()
endif ()

if (GLIBC_COMPATIBILITY)
set (USE_INTERNAL_MEMCPY ON)
if ((ARCH_AMD64 OR ARCH_AARCH64) AND OS_LINUX)
option (GLIBC_COMPATIBILITY "Set to TRUE to enable compatibility with older glibc libraries. Only for x86_64, Linux. Implies USE_INTERNAL_MEMCPY." ON)
endif ()

option (PIPE "-pipe compiler option [less /tmp usage, more ram usage]" ON)
Expand Down Expand Up @@ -380,8 +376,6 @@ if (ARCH_AMD64)
else()
add_definitions(-DTIFLASH_COMPILER_VPCLMULQDQ_SUPPORT=0)
endif()

check_cxx_compiler_flag("-mmovbe" TIFLASH_COMPILER_MOVBE_SUPPORT)
else()
add_definitions(-DTIFLASH_COMPILER_VPCLMULQDQ_SUPPORT=0)
endif()
Expand Down
Empty file removed Jenkinsfile
Empty file.
17 changes: 16 additions & 1 deletion cmake/cpu_features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,15 @@ elseif (ARCH_AMD64)
# so we do not set the flags to avoid core dump in old machines
option (TIFLASH_ENABLE_AVX_SUPPORT "Use AVX/AVX2 instructions on x86_64" ON)
option (TIFLASH_ENABLE_AVX512_SUPPORT "Use AVX512 instructions on x86_64" ON)

# `haswell` was released since 2013 with cpu feature avx2, bmi2. It's a practical arch for optimizer
option (TIFLASH_ENABLE_ARCH_HASWELL_SUPPORT "Use instructions based on architecture `haswell` on x86_64" ON)

option (NO_SSE42_OR_HIGHER "Disable SSE42 or higher on x86_64 for maximum compatibility with older/embedded hardware." OFF)
if (NO_SSE42_OR_HIGHER)
SET(TIFLASH_ENABLE_AVX_SUPPORT OFF)
SET(TIFLASH_ENABLE_AVX512_SUPPORT OFF)
SET (TIFLASH_ENABLE_ARCH_HASWELL_SUPPORT OFF)
endif()

set (TEST_FLAG "-mssse3")
Expand Down Expand Up @@ -171,7 +175,8 @@ elseif (ARCH_AMD64)
set (COMPILER_FLAGS "${COMPILER_FLAGS} ${TEST_FLAG}")
endif ()

set (TEST_FLAG "-mavx -mavx2")
set (TIFLASH_COMPILER_AVX2_FLAG "-mavx2")
set (TEST_FLAG "${TIFLASH_COMPILER_AVX2_FLAG}")
set (CMAKE_REQUIRED_FLAGS "${TEST_FLAG} -O0")
check_cxx_source_compiles("
#include <immintrin.h>
Expand Down Expand Up @@ -208,6 +213,16 @@ elseif (ARCH_AMD64)
add_definitions(-DTIFLASH_ENABLE_AVX512_SUPPORT=1)
endif ()

set (TIFLASH_COMPILER_MOVBE_FLAG "-mmovbe")
check_cxx_compiler_flag("${TIFLASH_COMPILER_MOVBE_FLAG}" TIFLASH_COMPILER_MOVBE_SUPPORT)
set (TIFLASH_COMPILER_BMI2_FLAG "-mbmi2")
check_cxx_compiler_flag("${TIFLASH_COMPILER_BMI2_FLAG}" TIFLASH_COMPILER_BMI2_SUPPORT)

set (TIFLASH_COMPILER_ARCH_HASWELL_FLAG "-march=haswell")
check_cxx_compiler_flag("${TIFLASH_COMPILER_ARCH_HASWELL_FLAG}" TIFLASH_COMPILER_ARCH_HASWELL_SUPPORT)
if (NOT TIFLASH_COMPILER_ARCH_HASWELL_SUPPORT)
set (TIFLASH_ENABLE_ARCH_HASWELL_SUPPORT OFF)
endif ()
else ()
# ignore all other platforms
endif ()
Expand Down
5 changes: 5 additions & 0 deletions contrib/lz4-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ add_library (lz4
target_compile_definitions(lz4 PUBLIC LZ4_DISABLE_DEPRECATE_WARNINGS=1)

target_include_directories(lz4 PUBLIC ${LIBRARY_DIR})

if (TIFLASH_ENABLE_ARCH_HASWELL_SUPPORT)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TIFLASH_COMPILER_ARCH_HASWELL_FLAG}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TIFLASH_COMPILER_ARCH_HASWELL_FLAG}")
endif ()
2 changes: 1 addition & 1 deletion contrib/tiflash-proxy
Submodule tiflash-proxy updated 220 files
2 changes: 1 addition & 1 deletion contrib/tipb
5 changes: 5 additions & 0 deletions contrib/zstd-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,8 @@ ENABLE_LANGUAGE(ASM)
ADD_LIBRARY(zstd ${Sources} ${Headers})

target_include_directories (zstd PUBLIC ${LIBRARY_DIR})

if (TIFLASH_ENABLE_ARCH_HASWELL_SUPPORT)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TIFLASH_COMPILER_ARCH_HASWELL_FLAG}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TIFLASH_COMPILER_ARCH_HASWELL_FLAG}")
endif ()
11 changes: 9 additions & 2 deletions dbms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 PingCAP, Ltd.
# Copyright 2023 PingCAP, Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,6 +62,7 @@ add_headers_and_sources(clickhouse_common_io src/IO)
add_headers_and_sources(dbms src/Analyzers)
add_headers_and_sources(dbms src/Core)
add_headers_and_sources(dbms src/DataStreams)
add_headers_and_sources(dbms src/Operators)
add_headers_and_sources(dbms src/DataTypes)
add_headers_and_sources(dbms src/Databases)
add_headers_and_sources(dbms src/Debug)
Expand All @@ -75,6 +76,7 @@ add_headers_and_sources(dbms src/Interpreters/ClusterProxy)
add_headers_and_sources(dbms src/Columns)
add_headers_and_sources(dbms src/Storages)
add_headers_and_sources(dbms src/Storages/DeltaMerge)
add_headers_and_sources(dbms src/Storages/DeltaMerge/BitmapFilter)
add_headers_and_sources(dbms src/Storages/DeltaMerge/Index)
add_headers_and_sources(dbms src/Storages/DeltaMerge/Filter)
add_headers_and_sources(dbms src/Storages/DeltaMerge/FilterParser)
Expand Down Expand Up @@ -105,9 +107,13 @@ add_headers_and_sources(dbms src/Client)
add_headers_only(dbms src/Flash/Coprocessor)
add_headers_only(dbms src/Server)

add_sources_compile_flag_avx2 (
check_then_add_sources_compile_flag (
TIFLASH_ENABLE_ARCH_HASWELL_SUPPORT
"${TIFLASH_COMPILER_ARCH_HASWELL_FLAG}"
src/Columns/ColumnString.cpp
src/Columns/ColumnsCommon.cpp
src/Columns/ColumnVector.cpp
src/DataTypes/DataTypeString.cpp
)

list (APPEND clickhouse_common_io_sources ${CONFIG_BUILD})
Expand Down Expand Up @@ -201,6 +207,7 @@ target_link_libraries (clickhouse_common_io
magic_enum
libsymbolization
)

target_include_directories (clickhouse_common_io BEFORE PRIVATE ${kvClient_SOURCE_DIR}/include)
target_compile_definitions(clickhouse_common_io PUBLIC -DTIFLASH_SOURCE_PREFIX=\"${TiFlash_SOURCE_DIR}\")
target_link_libraries (dbms
Expand Down
3 changes: 2 additions & 1 deletion dbms/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 PingCAP, Ltd.
# Copyright 2023 PingCAP, Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@ add_subdirectory (Columns)
add_subdirectory (Common)
add_subdirectory (Core)
add_subdirectory (DataStreams)
add_subdirectory (Operators)
add_subdirectory (DataTypes)
add_subdirectory (Dictionaries)
add_subdirectory (Storages)
Expand Down
Loading

0 comments on commit 337b187

Please sign in to comment.