[PATCH] D144956: Fix VGPR + offset Scratch offset folding

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 09:23:16 PST 2023


foad added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/memory_clause.ll:212
 ; GCN-SCRATCH-NEXT:    v_add_nc_u32_e32 v0, v0, v18
+; GCN-SCRATCH-NEXT:    v_add_nc_u32_e32 v6, 16, v0
+; GCN-SCRATCH-NEXT:    v_add_nc_u32_e32 v10, 32, v0
----------------
This looks correct but it is obviously less optimized than before. I wonder if we could get back to the optimized version by using `dereferenceable` info, or looking at the underlying object from the MMO, or something like that. E.g. if the address is of the form "baseptr + 16" and we know that the access is 16 bytes into a dereferenceable object, then we know that baseptr points to the start of that object, so it should be safe to use the vaddr + offset addressing mode.


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

https://reviews.llvm.org/D144956



More information about the llvm-commits mailing list