[all-commits] [llvm/llvm-project] e983d4: [AMDGPU] Pre-commit test for constant-offset named...

Chinmay Deshpande via All-commits all-commits at lists.llvm.org
Thu Jun 25 15:07:14 PDT 2026


  Branch: refs/heads/users/chinmaydd/named-barrier-gep-offset
  Home:   https://github.com/llvm/llvm-project
  Commit: e983d49b0c5969addb021bd9467460daae1a9b39
      https://github.com/llvm/llvm-project/commit/e983d49b0c5969addb021bd9467460daae1a9b39
  Author: Chinmay Deshpande <chdeshpa at amd.com>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    A llvm/test/CodeGen/AMDGPU/s-barrier-signal-var-gep-misaligned.ll

  Log Message:
  -----------
  [AMDGPU] Pre-commit test for constant-offset named barrier signal_var

A GEP into a named-barrier array (&bars[1]) lowers s_barrier_signal_var to
the dynamic m0 form on SelectionDAG, unlike the bare global and GlobalISel.
With object linking it emits a runtime add of the offset instead of folding
it into the relocation addend.

Also add a misaligned-offset test: a byte GEP that does not land on a
barrier boundary is valid IR and must not crash the compiler.

Change-Id: I7cea0dd64d050eb3e2143841e7136355cbb3bc50
Assisted-by: Cursor


  Commit: 16ef56580d1ac6ecced059b7d8559085135085db
      https://github.com/llvm/llvm-project/commit/16ef56580d1ac6ecced059b7d8559085135085db
  Author: Chinmay Deshpande <chdeshpa at amd.com>
  Date:   2026-06-25 (Thu, 25 Jun 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
    M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
    R llvm/test/CodeGen/AMDGPU/s-barrier-signal-var-gep-misaligned.ll
    M llvm/test/CodeGen/AMDGPU/s-barrier-signal-var-gep.ll

  Log Message:
  -----------
  [AMDGPU] Fold constant offsets into named barrier addresses

Allow isOffsetFoldingLegal to fold a constant offset into an LDS
named-barrier global, and include the node offset when materializing the
LDS address in LowerGlobalAddress. s_barrier_signal_var on a GEP'd named
barrier now selects the immediate form, matching a bare global and GlobalISel.
With object linking the offset folds into the relocation addend.

The barrier ID is derived from the address via (addr >> 4) & 0x3F, so a
byte offset that does not land on a 16-byte barrier boundary is still
valid: it simply selects the containing barrier. No alignment assertion
is needed, and such offsets must not crash the compiler (see the
misaligned test).

Change-Id: I639bc723eb001573585cc05d0ad19f2773054f21
Assisted-by: Cursor


Compare: https://github.com/llvm/llvm-project/compare/de4a78d03c31...16ef56580d1a

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