[all-commits] [llvm/llvm-project] bc3eb5: [CIR] Lower __atomic_is_lock_free / __c11_atomic_i...

adams381 via All-commits all-commits at lists.llvm.org
Thu Jun 25 10:56:52 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bc3eb524b2d1dcc3e48161cd2eb80a2364fdc097
      https://github.com/llvm/llvm-project/commit/bc3eb524b2d1dcc3e48161cd2eb80a2364fdc097
  Author: adams381 <adams at nvidia.com>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
    A clang/test/CIR/CodeGen/builtin-atomic-is-lock-free.c

  Log Message:
  -----------
  [CIR] Lower __atomic_is_lock_free / __c11_atomic_is_lock_free (#205862)

`__atomic_is_lock_free` and `__c11_atomic_is_lock_free` were routed to
`errorNYI` in CIRGen, so `std::atomic<T>::is_lock_free()` failed to
compile under `-fclangir` whenever the query wasn't constant-folded --
which is what the libcxx atomics lock-free tests hit.

This mirrors classic CodeGen (`CGBuiltin.cpp`): emit a call to the
runtime entry `bool __atomic_is_lock_free(size_t size, void *ptr)`.
`__atomic_is_lock_free` forwards its pointer argument;
`__c11_atomic_is_lock_free` passes a null pointer, since an `_Atomic`
object is always suitably aligned. `__atomic_test_and_set` /
`__atomic_clear` stay NYI.

The lowered call omits the `noundef`/`zeroext` argument and return
attributes classic emits, and the declaration picks up `dso_local`.
That's the existing CIR libcall attribute gap, so the test uses split
`LLVMCIR`/`OGCG` prefixes where the two diverge and a shared skeleton
where they match.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list