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

Matt Arsenault via All-commits all-commits at lists.llvm.org
Fri Sep 6 10:40:57 PDT 2024


  Branch: refs/heads/users/arsenm/noalias-addrspace-metadata
  Home:   https://github.com/llvm/llvm-project
  Commit: bf76af555c37e70a93d0f7bc2b37b6f80d1b894b
      https://github.com/llvm/llvm-project/commit/bf76af555c37e70a93d0f7bc2b37b6f80d1b894b
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2024-09-06 (Fri, 06 Sep 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: c916c243aec85fa2941eff27747ccacefe00f068
      https://github.com/llvm/llvm-project/commit/c916c243aec85fa2941eff27747ccacefe00f068
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2024-09-06 (Fri, 06 Sep 2024)

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

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


  Commit: 433683a5d2862a49892aa95d4fe7034bee15543c
      https://github.com/llvm/llvm-project/commit/433683a5d2862a49892aa95d4fe7034bee15543c
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2024-09-06 (Fri, 06 Sep 2024)

  Changed paths:
    M llvm/docs/LangRef.rst

  Log Message:
  -----------
  Fix doc build


  Commit: 416b1377e96eb2dc2963dece588a7641dd6d667d
      https://github.com/llvm/llvm-project/commit/416b1377e96eb2dc2963dece588a7641dd6d667d
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2024-09-06 (Fri, 06 Sep 2024)

  Changed paths:
    M llvm/test/Transforms/InstCombine/loadstore-metadata.ll
    M llvm/test/Transforms/SimplifyCFG/hoist-with-metadata.ll

  Log Message:
  -----------
  Add baseline tests for some optimization handling


  Commit: c3dbcec2937921cd425af977dcfa89e920757809
      https://github.com/llvm/llvm-project/commit/c3dbcec2937921cd425af977dcfa89e920757809
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2024-09-06 (Fri, 06 Sep 2024)

  Changed paths:
    M llvm/docs/LangRef.rst

  Log Message:
  -----------
  Add another comment


Compare: https://github.com/llvm/llvm-project/compare/16dd0922f3c9...c3dbcec29379

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