[all-commits] [llvm/llvm-project] 99d67f: [OpenMP] Align up the size when calling aligned_al...

Shilei Tian via All-commits all-commits at lists.llvm.org
Wed Sep 6 13:28:22 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 99d67fb9aad6382c41fffdedc4d4dbadd20d5da4
      https://github.com/llvm/llvm-project/commit/99d67fb9aad6382c41fffdedc4d4dbadd20d5da4
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2023-09-06 (Wed, 06 Sep 2023)

  Changed paths:
    M openmp/runtime/src/kmp_barrier.h

  Log Message:
  -----------
  [OpenMP] Align up the size when calling aligned_alloc (#65525)

Based on https://en.cppreference.com/w/c/memory/aligned_alloc, the
`size` is supposed
to be a multiple of `alignment`, and it is implementation defined
behavior if not.
We have a non-conformant use in `kmp_barrier.h` when allocating
distribute barrier.
The size of the barrier is 576 and the alignment is `4*CACHE_LINE`,
which is 256
on most systems. Apparently it works perfectly fine for Linux and
Intel-based Mac,
but not for Apple Silicon based Mac.

Fix #63194.




More information about the All-commits mailing list