[llvm] Partition MUBUF load/store offsets into vector and scalar parts (PR #142328)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 16 02:14:23 PDT 2025


jayfoad wrote:

> Following instructions:
> ```
> v_add_u32 v1, v0, sN
> buffer_{load,store}_T v*, s[buf:buf+3], v1 offen
> ```
> can be optimized to:
> ```
> buffer_{load,store}_T v*, s[buf:buf+3], v0, sN offen
> ```

How is this safe in general? According to this comment "the offset and soffset arguments ... behave differently in bounds checking and swizzling", so it seems like your optimization could change behaviour?
https://github.com/llvm/llvm-project/blob/a75e0627f97ccc36ec222a53c6a1106157a380ac/llvm/include/llvm/IR/IntrinsicsAMDGPU.td#L1336

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


More information about the llvm-commits mailing list