[PATCH] D133787: [AMDGPU][SILoadStoreOptimizer] Merge SGPR_IMM scalar buffer loads.

Ivan Kosarev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 14 09:11:32 PDT 2022


kosarev marked an inline comment as done.
kosarev added a comment.

In D133787#3788908 <https://reviews.llvm.org/D133787#3788908>, @foad wrote:

> I can't resist pointing out that this patch would be simpler if we never used the _SGPR form on subtargets where the _SGPR_IMM form is available.

True, the implementation would be a bit simpler. I don't mind it either way, it's just that a slightly simpler implementation doesn't necessarily work as an obviously sufficient argument when it comes to user-faced things. I guess some wider discussion might help here.



================
Comment at: llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp:1388
+  // zero-offset load, we generate its SGPR variant.
+  if (AMDGPU::getNamedOperandIdx(Opcode, AMDGPU::OpName::offset) != -1)
+    New.addImm(MergedOffset);
----------------
Also changed this line to what looks to me a more reliable implementation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133787



More information about the llvm-commits mailing list