diff --git a/libc/src/string/CMakeLists.txt b/libc/src/string/CMakeLists.txt --- a/libc/src/string/CMakeLists.txt +++ b/libc/src/string/CMakeLists.txt @@ -279,7 +279,6 @@ ${ARGN}) if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - list(APPEND ADD_IMPL_MLLVM_COMPILE_OPTIONS "-combiner-global-alias-analysis") # Note that '-mllvm' needs to be prefixed with 'SHELL:' to prevent CMake flag deduplication. foreach(opt IN LISTS ADD_IMPL_MLLVM_COMPILE_OPTIONS) list(APPEND ADD_IMPL_COMPILE_OPTIONS "SHELL:-mllvm ${opt}") diff --git a/libc/src/string/memory_utils/memcpy_implementations.h b/libc/src/string/memory_utils/memcpy_implementations.h --- a/libc/src/string/memory_utils/memcpy_implementations.h +++ b/libc/src/string/memory_utils/memcpy_implementations.h @@ -39,11 +39,11 @@ static inline void inline_memcpy(char *__restrict dst, const char *__restrict src, size_t count) { + using namespace __llvm_libc::builtin; #if defined(LLVM_LIBC_ARCH_X86) ///////////////////////////////////////////////////////////////////////////// // LLVM_LIBC_ARCH_X86 ///////////////////////////////////////////////////////////////////////////// - using namespace __llvm_libc::x86; // Whether to use only rep;movsb. constexpr bool USE_ONLY_REP_MOVSB = @@ -69,7 +69,7 @@ #endif if (USE_ONLY_REP_MOVSB) - return copy(dst, src, count); + return copy(dst, src, count); if (count == 0) return; @@ -96,12 +96,11 @@ if (count <= REP_MOVS_B_SIZE) return copy::Then>>(dst, src, count); - return copy(dst, src, count); + return copy(dst, src, count); #elif defined(LLVM_LIBC_ARCH_AARCH64) ///////////////////////////////////////////////////////////////////////////// // LLVM_LIBC_ARCH_AARCH64 ///////////////////////////////////////////////////////////////////////////// - using namespace __llvm_libc::scalar; if (count == 0) return; if (count == 1) @@ -127,7 +126,6 @@ ///////////////////////////////////////////////////////////////////////////// // Default ///////////////////////////////////////////////////////////////////////////// - using namespace __llvm_libc::scalar; if (count == 0) return; if (count == 1) diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel @@ -829,7 +829,6 @@ copts = [ "-fno-builtin-memcpy", "-fno-builtin-memmove", - "-mllvm -combiner-global-alias-analysis", "-mllvm --tail-merge-threshold=0", ], features = no_sanitize_features, @@ -845,7 +844,6 @@ hdrs = ["src/string/memset.h"], copts = [ "-fno-builtin-memset", - "-mllvm -combiner-global-alias-analysis", ], features = no_sanitize_features, deps = [ @@ -860,7 +858,6 @@ hdrs = ["src/string/memmove.h"], copts = [ "-fno-builtin-memmove", - "-mllvm -combiner-global-alias-analysis", ], features = no_sanitize_features, deps = [ @@ -876,7 +873,6 @@ hdrs = ["src/string/memcmp.h"], copts = [ "-fno-builtin-memcmp", - "-mllvm -combiner-global-alias-analysis", ], features = no_sanitize_features, deps = [ @@ -908,7 +904,6 @@ copts = [ "-fno-builtin-bzero", "-fno-builtin-memset", - "-mllvm -combiner-global-alias-analysis", ], features = no_sanitize_features, deps = [