[all-commits] [llvm/llvm-project] 00530d: [compiler-rt] Implement __atomic_is_lock_free

Alexander Richardson via All-commits all-commits at lists.llvm.org
Fri Jan 8 04:49:05 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 00530dee5d1295dc20ebafdd9a8a79662f41513e
      https://github.com/llvm/llvm-project/commit/00530dee5d1295dc20ebafdd9a8a79662f41513e
  Author: Alex Richardson <Alexander.Richardson at cl.cam.ac.uk>
  Date:   2021-01-08 (Fri, 08 Jan 2021)

  Changed paths:
    M compiler-rt/lib/builtins/atomic.c
    M compiler-rt/test/builtins/Unit/atomic_test.c

  Log Message:
  -----------
  [compiler-rt] Implement __atomic_is_lock_free

This function is called by the __atomic_is_lock_free() builtin if the value
cannot be resolved to true at compile time. Lack of this function is
causing the non-lockfree atomics tests in libc++ to not be run (see D91911)

This function is also added in D85044, but that review also adds support
for using lock-free atomics in more cases, whereas this is a minimal change
that just adds __atomic_is_lock_free() for the implementation of atomic.c.

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D92302


  Commit: 32733c347d7bc77ce2c40b067a3bdaadc4b8aadf
      https://github.com/llvm/llvm-project/commit/32733c347d7bc77ce2c40b067a3bdaadc4b8aadf
  Author: Alex Richardson <Alexander.Richardson at cl.cam.ac.uk>
  Date:   2021-01-08 (Fri, 08 Jan 2021)

  Changed paths:
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_strong_explicit.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_compare_exchange_weak_explicit.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_exchange_explicit.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_helpers.h
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_init.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_is_lock_free.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_load_explicit.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.req/atomic_store_explicit.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp

  Log Message:
  -----------
  [libc++] Add missing XFAIL to tests that need __atomic_* libcalls

FreeBSD did not provide the __atomic_* functions as part of the base
system until recently. They were added to libgcc_s in SVN revision r364753
(August 2020), so check for availability of 'non-lockfree-atomics' so that
these tests do not fail unexpectedly on older versions of FreeBSD.

This also removes the #ifndef __APPLE__ from atomic_helpers.h that was used
to work around lack of atomic runtime functions on older Apple platforms
and replaces it with XFAIL: !non-lockfree-atomics.

Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D88818


Compare: https://github.com/llvm/llvm-project/compare/99c84af1a25a...32733c347d7b


More information about the All-commits mailing list