From 16a9e95605791b1ea73b4973e115a74ddd019e02 Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Thu, 25 Jan 2024 15:40:11 +0000 Subject: [PATCH] Minor cleanup of msan usage --- src/Common/SymbolIndex.cpp | 16 +--------------- src/Compression/CompressionCodecDeflateQpl.cpp | 13 +++++-------- src/Functions/FunctionsStringSimilarity.cpp | 3 +-- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/Common/SymbolIndex.cpp b/src/Common/SymbolIndex.cpp index 8e8ffa4d8b7..8dde617fc74 100644 --- a/src/Common/SymbolIndex.cpp +++ b/src/Common/SymbolIndex.cpp @@ -1,6 +1,7 @@ #if defined(__ELF__) && !defined(OS_FREEBSD) #include +#include #include #include @@ -55,21 +56,6 @@ Otherwise you will get only exported symbols from program headers. */ -#if defined(__clang__) -# pragma clang diagnostic ignored "-Wreserved-id-macro" -# pragma clang diagnostic ignored "-Wunused-macros" -#endif - -#define __msan_unpoison_string(X) // NOLINT -#define __msan_unpoison(X, Y) // NOLINT -#if defined(ch_has_feature) -# if ch_has_feature(memory_sanitizer) -# undef __msan_unpoison_string -# undef __msan_unpoison -# include -# endif -#endif - namespace DB { diff --git a/src/Compression/CompressionCodecDeflateQpl.cpp b/src/Compression/CompressionCodecDeflateQpl.cpp index ee0356adde5..292f729a38d 100644 --- a/src/Compression/CompressionCodecDeflateQpl.cpp +++ b/src/Compression/CompressionCodecDeflateQpl.cpp @@ -6,14 +6,15 @@ #include #include #include -#include -#include -#include "libaccel_config.h" #include +#include +#include #include #include -#include +#include "libaccel_config.h" + +#include namespace DB { @@ -416,9 +417,7 @@ UInt32 CompressionCodecDeflateQpl::doCompressData(const char * source, UInt32 so { /// QPL library is using AVX-512 with some shuffle operations. /// Memory sanitizer don't understand if there was uninitialized memory in SIMD register but it was not used in the result of shuffle. -#if defined(MEMORY_SANITIZER) __msan_unpoison(dest, getMaxCompressedDataSize(source_size)); -#endif Int32 res = HardwareCodecDeflateQpl::RET_ERROR; if (DeflateQplJobHWPool::instance().isJobPoolReady()) res = hw_codec->doCompressData(source, source_size, dest, getMaxCompressedDataSize(source_size)); @@ -439,9 +438,7 @@ void CompressionCodecDeflateQpl::doDecompressData(const char * source, UInt32 so { /// QPL library is using AVX-512 with some shuffle operations. /// Memory sanitizer don't understand if there was uninitialized memory in SIMD register but it was not used in the result of shuffle. -#if defined(MEMORY_SANITIZER) __msan_unpoison(dest, uncompressed_size); -#endif /// Device IOTLB miss has big perf. impact for IAA accelerators. /// To avoid page fault, we need touch buffers related to accelerator in advance. touchBufferWithZeroFilling(dest, uncompressed_size); diff --git a/src/Functions/FunctionsStringSimilarity.cpp b/src/Functions/FunctionsStringSimilarity.cpp index df068531655..aadf5c246fc 100644 --- a/src/Functions/FunctionsStringSimilarity.cpp +++ b/src/Functions/FunctionsStringSimilarity.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -108,10 +109,8 @@ struct NgramDistanceImpl if constexpr (case_insensitive) { -#if defined(MEMORY_SANITIZER) /// Due to PODArray padding accessing more elements should be OK __msan_unpoison(code_points + (N - 1), padding_offset * sizeof(CodePoint)); -#endif /// We really need template lambdas with C++20 to do it inline unrollLowering(code_points, std::make_index_sequence()); }