summaryrefslogtreecommitdiff
path: root/0026-GOMP-Enabling-moutline-atomics-improves-libgomp-perf.patch
blob: b57a5a6f9e6ba4b3d4d83d7ac305deefd57f5900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 7efae59159577657f22511aa3b2cebe85ca60d9d Mon Sep 17 00:00:00 2001
From: dingguangya <dingguangya1@huawei.com>
Date: Mon, 4 Sep 2023 16:30:58 +0800
Subject: [PATCH 2/2] [GOMP] Enabling moutline-atomics improves libgomp
 performance in multi-thread scenarios

Libgomp is used in multi-thread scenarios,
Enabling moutline-atomics improves performance.
---
 libgomp/configure.tgt | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt
index 2cd7272fc..f924e9f98 100644
--- a/libgomp/configure.tgt
+++ b/libgomp/configure.tgt
@@ -32,6 +32,17 @@ if test $gcc_cv_have_tls = yes ; then
   esac
 fi
 
+# Enabling moutline-atomics improves libgomp performance in multi-thread scenarios.
+case "${target_cpu}" in
+  aarch64*)
+        case "${target}" in
+            aarch64*-*-linux*)
+                XCFLAGS="${XCFLAGS} -moutline-atomics"
+                ;;
+        esac
+        ;;
+esac
+
 tmake_file=
 # Since we require POSIX threads, assume a POSIX system by default.
 config_path="posix"
-- 
2.33.0