This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new f6359ae8065 [Enhance](thirdparty) Enable phmap intrinsic int128 
support on Clang … (#69144)
f6359ae8065 is described below

commit f6359ae80659c43cc847223278ff9ec808b7ee19
Author: linrrarity <[email protected]>
AuthorDate: Tue Oct 20 12:08:16 2026 +0800

    [Enhance](thirdparty) Enable phmap intrinsic int128 support on Clang … 
(#69144)
    
    ### What problem does this PR solve?
    
    Issue Number: None
    
    Related PR: None
    
    Problem Summary:
    
    The bundled parallel-hashmap 1.3.8 disables intrinsic 128-bit integer
    support for Clang on AArch64. This selects the fallback 64-bit hash
    mixing path, contributing to slow hash-set lookups on ARM.
    
    Backport the ARM detection fix from upstream parallel-hashmap PR
    [#290:](https://github.com/greg7mdp/parallel-hashmap/pull/290)
    
    
    ### Release note
---
 thirdparty/download-thirdparty.sh                  | 12 +++++++++++
 .../parallel-hashmap-1.3.8-aarch64-int128.patch    | 23 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/thirdparty/download-thirdparty.sh 
b/thirdparty/download-thirdparty.sh
index c519687e4d1..c65ea6dfd7d 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -800,4 +800,16 @@ if [[ " ${TP_ARCHIVES[*]} " =~ " BOOST " ]]; then
     echo "Finished patching ${BOOST_SOURCE}"
 fi
 
+# Clang on AArch64 supports __int128. Enable phmap's multiply-based hash mixer
+# instead of falling back to the longer shift/xor implementation.
+if [[ " ${TP_ARCHIVES[*]} " =~ " PARALLEL_HASHMAP " ]]; then
+    cd "${TP_SOURCE_DIR}/${PARALLEL_HASHMAP_SOURCE}"
+    if [[ ! -f "${PATCHED_MARK}_aarch64_int128" ]]; then
+        patch -p1 
<"${TP_PATCH_DIR}/parallel-hashmap-1.3.8-aarch64-int128.patch"
+        touch "${PATCHED_MARK}_aarch64_int128"
+    fi
+    cd -
+    echo "Finished patching ${PARALLEL_HASHMAP_SOURCE} for AArch64 int128"
+fi
+
 # vim: ts=4 sw=4 ts=4 tw=100:
diff --git a/thirdparty/patches/parallel-hashmap-1.3.8-aarch64-int128.patch 
b/thirdparty/patches/parallel-hashmap-1.3.8-aarch64-int128.patch
new file mode 100644
index 00000000000..47c171e54dd
--- /dev/null
+++ b/thirdparty/patches/parallel-hashmap-1.3.8-aarch64-int128.patch
@@ -0,0 +1,23 @@
+Backport upstream 4e410c7af3f93c4928c1fc84413720a2935ecd4a (PR #290).
+Keep the ARM32 exclusion while enabling intrinsic multiplication on ARM64.
+https://github.com/greg7mdp/parallel-hashmap/pull/290
+
+diff --git a/parallel_hashmap/phmap_config.h b/parallel_hashmap/phmap_config.h
+--- a/parallel_hashmap/phmap_config.h
++++ b/parallel_hashmap/phmap_config.h
+@@ -208,10 +208,14 @@
+ // Checks whether the __int128 compiler extension for a 128-bit 
+ // integral type is supported.
+ // ------------------------------------------------------------
++#if defined(__arm__) && !defined(__aarch64__)
++    #define PHMAP_ARM_32
++#endif
++
+ #ifdef PHMAP_HAVE_INTRINSIC_INT128
+     #error PHMAP_HAVE_INTRINSIC_INT128 cannot be directly set
+ #elif defined(__SIZEOF_INT128__)
+-    #if (defined(__clang__) && !defined(_WIN32) && !defined(__aarch64__)) || \
++    #if (defined(__clang__) && !defined(_WIN32) && !defined(PHMAP_ARM_32)) || 
\
+         (defined(__CUDACC__) && __CUDACC_VER_MAJOR__ >= 9) ||                \
+         (defined(__GNUC__) && !defined(__clang__) && !defined(__CUDACC__))
+         #define PHMAP_HAVE_INTRINSIC_INT128 1


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to