[clang] [llvm] [clang][amdgpu] Add builtins for raw/struct buffer lds load (PR #137678)

Krzysztof Drewniak via cfe-commits cfe-commits at lists.llvm.org
Thu May 1 09:20:29 PDT 2025


krzysz00 wrote:

> It does, we should have a consistent set of buffer builtins

To specify what I _think_ the proposed rewrite is, it's auto-upgrading or otherwise transforming
```llvm
%r = call T llvm.amdgcn.{raw,struct}.buffer.*(<4 x i32> %rsrc, ...)
```
into
```llvm
%rsrc.int = bitcast <4 x i32> %rsrc to i128
%rsrc.ptr = inttoptr i128 %rsrc.int to ptr addrspace(8)
%r = call T @lvm.amdgcn.{raw,struct}.ptr.*(ptr addrspace(8) %rsrc, ...)
```

plus putting some deprecation notices on the 4xi32 versions

https://github.com/llvm/llvm-project/pull/137678


More information about the cfe-commits mailing list