[PATCH] D137066: [AMDGPU] Add amdgcn_s_buffer_load_imm intrinsic

Piotr Sobczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 01:22:20 PDT 2022


piotr added a comment.

In D137066#3898225 <https://reviews.llvm.org/D137066#3898225>, @arsenm wrote:

> What's the problem with using a constant offset with the existing intrinsic?

That would work fine, but the problem is that the existing intrinsic has just one offset field and relies on the isel to extract the const part to utilize the instruction offset immediate field. The new intrinsic in addition to the existing scalar offset exposes the constant part that lets us use the immediate field of the instruction directly. So the new intrinsic would let us include "1024" as an immediate in the example below:

`%load = call i32 @llvm.amdgcn.s.buffer.load.imm.i32(<4 x i32> %desc, i32 %index, i32 1024, i32 0)`

(I know there are new tests with a constant for soffset and 0 for the immediate offset field, but these are to ensure the generated code is the same as with the old intrinsic. The use case with two constant offsets is really not a real-world case - the main use case is a scalar offset with separate constant offset).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137066



More information about the llvm-commits mailing list