[PATCH] D129095: [AMDGPU][CodeGen] Match complex register SMRD offsets.

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 01:48:42 PDT 2022


foad added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/amdgcn-load-offset-from-reg.ll:33
+; GCN: S_LOAD_DWORD_SGPR
+define amdgpu_ps void @test_complex_reg_offset(float addrspace(1)* %out) {
+  %i = load i32, i32 addrspace(4)* @1
----------------
When this patch and D128836 have both landed, can you add GISEL checks here please.


================
Comment at: llvm/test/CodeGen/AMDGPU/amdgcn-load-offset-from-reg.ll:35
+  %i = load i32, i32 addrspace(4)* @1
+  %1 = and i32 %i, 3
+  %2 = zext i32 %1 to i64
----------------
Please don't use unnamed values in tests. (You can run the IR through `opt -instnamer` to name them automatically.)


================
Comment at: llvm/test/CodeGen/AMDGPU/amdgcn-load-offset-from-reg.ll:37
+  %2 = zext i32 %1 to i64
+  %3 = getelementptr [4 x <2 x float>], [4 x <2 x float>] addrspace(4)* @0, i64 0, i64 %2, i64 0
+  %4 = load float, float addrspace(4)* %3, align 4
----------------
Do I understand correctly: in SDag this gep ends up as `(add %2, @0) ` (not `(add @0, %2)`) because `@0` is a constant so it gets canonicalized to the RHS?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129095



More information about the llvm-commits mailing list