[llvm-branch-commits] [openmp] Revert "release/18.x: [openmp] __kmp_x86_cpuid fix for i386/PIC builds. (#84626)" (PR #85527)

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Mar 19 13:04:23 PDT 2024


https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/85527

>From 2d35ba4a85774074bd17186aa44451772d3a9a27 Mon Sep 17 00:00:00 2001
From: David CARLIER <devnexen at gmail.com>
Date: Sat, 16 Mar 2024 13:41:33 +0000
Subject: [PATCH] =?UTF-8?q?Revert=20"release/18.x:=20[openmp]=20=5F=5Fkmp?=
 =?UTF-8?q?=5Fx86=5Fcpuid=20fix=20for=20i386/PIC=20builds.=20(#846?=
 =?UTF-8?q?=E2=80=A6"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit 9b3edb592debc00a5c3fbf7a71f63e07d6af44be.
---
 openmp/runtime/src/kmp.h | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index d51ec886cfe556..e3a1e20731bbe0 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -1403,19 +1403,9 @@ extern void __kmp_query_cpuid(kmp_cpuinfo_t *p);
 // subleaf is only needed for cache and topology discovery and can be set to
 // zero in most cases
 static inline void __kmp_x86_cpuid(int leaf, int subleaf, struct kmp_cpuid *p) {
-#if KMP_ARCH_X86 && (defined(__pic__) || defined(__PIC__))
-  // on i386 arch, the ebx reg. is used by pic, thus we need to preserve from
-  // being trashed beforehand
-  __asm__ __volatile__("mov %%ebx, %%edi\n"
-                       "cpuid\n"
-                       "xchg %%edi, %%ebx\n"
-                       : "=a"(p->eax), "=b"(p->ebx), "=c"(p->ecx), "=d"(p->edx)
-                       : "a"(leaf), "c"(subleaf));
-#else
   __asm__ __volatile__("cpuid"
                        : "=a"(p->eax), "=b"(p->ebx), "=c"(p->ecx), "=d"(p->edx)
                        : "a"(leaf), "c"(subleaf));
-#endif
 }
 // Load p into FPU control word
 static inline void __kmp_load_x87_fpu_control_word(const kmp_int16 *p) {



More information about the llvm-branch-commits mailing list