[PATCH] D124884: [AMDGPU] Add intrinsic llvm.amdgcn.raw.buffer.load.lds

Raman R jana via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 6 08:03:16 PDT 2022


ramjana added a comment.

In D124884#3489729 <https://reviews.llvm.org/D124884#3489729>, @arsenm wrote:

> Why does this need an intrinsic? I thought the whole point of the LDS DMA thing was an optimization the backend would perform and doesn't need to be exposed directly



In D124884#3492464 <https://reviews.llvm.org/D124884#3492464>, @rampitec wrote:

> - Removed the overload and added i32 %size operand instead.
> - LDS pointer is i8 addrspace(3) now qualified with the address space.
> - Rebased on the change to handle hazards between m0 initialization and these operations.



In D124884#3492464 <https://reviews.llvm.org/D124884#3492464>, @rampitec wrote:

> - Removed the overload and added i32 %size operand instead.
> - LDS pointer is i8 addrspace(3) now qualified with the address space.
> - Rebased on the change to handle hazards between m0 initialization and these operations.

Just to be clear , Is your expectation that intrinsic user to save and restore m0 before calling buffer_load lds intrinsic?



================
Comment at: llvm/test/CodeGen/AMDGPU/llvm.amdgcn.raw.buffer.load.lds.ll:16
+; GCN:       ; %bb.0: ; %main_body
+; GCN-NEXT:    s_mov_b32 m0, s4
+; GCN-NEXT:    buffer_load_dword off, s[0:3], 0 lds
----------------
arsenm wrote:
> rampitec wrote:
> > asroy wrote:
> > > m0 holds the size of LDS, should we save the value of m0 before overwriting it, and write the value back before issuing ds_read?
> > DS_* do not read M0 since gfx9. These intrinsics are only available since gfx9.
> > Moreover, on gfx8 and earlier selection of DS opcodes takes care about M0 initialization right before the opcode.
> Every user of m0 is supposed to set it itself, and we hopefully clean up the redundant rewrites. It's not something that's generally saved and restored per operation
Just to be clear , Is your expectation that intrinsic user  to save and restore m0 before calling buffer_load lds intrinsic?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124884/new/

https://reviews.llvm.org/D124884



More information about the llvm-commits mailing list