[clang] [llvm] [AMDGPU] Add a new builtin type for image descriptor rsrc (PR #160258)

Rana Pratap Reddy via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 23:04:02 PDT 2025


ranapratap55 wrote:

If I use opaque ptr macro, getting below IR where the intrinsic texture type will become ptr
>  %2 = load ptr, ptr %vec8i32.addr.ascast, align 32
>  %3 = call float @llvm.amdgcn.image.load.2d.f32.i32.p0(i32 12, i32 %0, i32 %1, ptr %2, i32 106, i32 103)

and
If I use new macro, IR generates like below with intrinsic getting the correct <8 x i32>
>  %2 = load <8 x i32>, ptr %vec8i32.addr.ascast, align 32
>  %3 = call float @llvm.amdgcn.image.load.2d.f32.i32.v8i32(i32 12, i32 %0, i32 %1, <8 x i32> %2, i32 106, i32 103)

I believe using new macro is better, let me know If I missed anything.

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


More information about the llvm-commits mailing list