[llvm] [AMDGPU] Avoid setting GLC for image atomics when result is unused (PR #150742)

Harrison Hao via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 19 04:22:30 PDT 2025


harrisonGPU wrote:

> > I'm working on implementing no-return type image atomic intrinsics and instructions.
> 
> We don't need new intrinsics, only new MachineInstrs.
> 
> > I'm happy to work on adding proper no-return variants, this is my first time writing tablegen. :-)
> 
> @sstipano has done a lot of work in `MIMGInstructions.td` recently and might be able to help if you need some help.

I think we may need a new intrinsic.? For example, I’ve already implemented a draft that lowers:
```llvm
call void @llvm.amdgcn.image.atomic.add.1d.nortn.i32.i32(i32 %data, i32 %s, <8 x i32> %rsrc, i32 0, i32 0)
```
to
```
image_atomic_add off, v0, v1, s[0:7] dmask:0x1 dim:SQ_RSRC_IMG_1D unorm
```

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


More information about the llvm-commits mailing list