[all-commits] [llvm/llvm-project] e51102: [RFC] IR: Define noalias.addrspace metadata

Matt Arsenault via All-commits all-commits at lists.llvm.org
Fri Aug 9 04:06:30 PDT 2024


  Branch: refs/heads/users/arsenm/noalias-addrspace-metadata
  Home:   https://github.com/llvm/llvm-project
  Commit: e51102b41f39e63c2db2ae702f02e7720636b198
      https://github.com/llvm/llvm-project/commit/e51102b41f39e63c2db2ae702f02e7720636b198
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2024-08-09 (Fri, 09 Aug 2024)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/docs/ReleaseNotes.rst
    M llvm/include/llvm/IR/FixedMetadataKinds.def
    M llvm/lib/IR/Verifier.cpp
    A llvm/test/Assembler/noalias-addrspace-md.ll
    A llvm/test/Verifier/noalias-addrspace.ll

  Log Message:
  -----------
  [RFC] IR: Define noalias.addrspace metadata

This is intended to solve a problem with lowering atomics in
OpenMP and C++ common to AMDGPU and NVPTX.

In OpenCL and CUDA, it is undefined behavior for an atomic instruction
to modify an object in thread private memory. In OpenMP, it is defined.
Correspondingly, the hardware does not handle this correctly. For AMDGPU,
32-bit atomics work and 64-bit atomics are silently dropped. We therefore
need to codegen this by inserting a runtime address space check, performing
the private case without atomics, and fallback to issuing the real atomic
otherwise. This metadata allows us to avoid this extra check and branch.

Handle this by introducing metadata intended to be applied to atomicrmw,
indicating they cannot access the forbidden address space.


  Commit: 1e084c60baae3b84e11e888c78303c3930af610f
      https://github.com/llvm/llvm-project/commit/1e084c60baae3b84e11e888c78303c3930af610f
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2024-08-09 (Fri, 09 Aug 2024)

  Changed paths:
    M llvm/lib/IR/Verifier.cpp

  Log Message:
  -----------
  Use enum for range like metadata kinds


Compare: https://github.com/llvm/llvm-project/compare/e403d08bf53a...1e084c60baae

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