[Openmp-commits] [PATCH] D60894: openmp: Align kmp_int64 and kmp_uint64 to 64 bits.
Peter Collingbourne via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Apr 18 15:54:03 PDT 2019
pcc created this revision.
pcc added a reviewer: jlpeyton.
Herald added subscribers: jdoerfert, jfb, guansong.
Herald added a project: OpenMP.
On 32-bit x86, both of these types have an alignment of 32 bits, which means
that atomic operations involving these types require a runtime call. We can
avoid the overhead of the runtime call, as well as a dependency on libatomic,
by aligning both types to 64 bits.
As far as I can tell these types are not part of the library's public
interface, so this change should be fine from an ABI perspective.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D60894
Files:
openmp/runtime/src/kmp_os.h
Index: openmp/runtime/src/kmp_os.h
===================================================================
--- openmp/runtime/src/kmp_os.h
+++ openmp/runtime/src/kmp_os.h
@@ -155,8 +155,8 @@
typedef unsigned short kmp_uint16;
typedef int kmp_int32;
typedef unsigned int kmp_uint32;
-typedef long long kmp_int64;
-typedef unsigned long long kmp_uint64;
+typedef __attribute__((aligned(8))) long long kmp_int64;
+typedef __attribute__((aligned(8))) unsigned long long kmp_uint64;
#define KMP_INT32_SPEC "d"
#define KMP_UINT32_SPEC "u"
#define KMP_INT64_SPEC "lld"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60894.195829.patch
Type: text/x-patch
Size: 564 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190418/ebb8002e/attachment.bin>
More information about the Openmp-commits
mailing list