[PATCH] D109594: [AMDGPU] Initialize LDS pointers after alloca, but before call.

Mahesha S via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 18:01:33 PDT 2021


hsmhsm marked an inline comment as done.
hsmhsm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp:443
+       ++KI) {
+    if (hasAllocaAfterCall(KI->first))
+      return false;
----------------
arsenm wrote:
> I don't like this arbitrary condition. Why not just collect all allocas and re-insert them at the start of the entry block?
Even I do not like it.

But I do not know, how *neat* and how *quick* the implementation of moving all allocas to entry block. While researching and googling I found in some llvm discussion that there was an effort (not sure if it was a pass) to do that generically, but later it was removed due to some (genuine) reason.

Considering the necessity of keeping allocas at the entry block from the LLVM point of view, I think someone must have done it if it was feasible. So, I do not want to deviate again from my main task of LDS stuff  and keep it hold for unknown time as it is already delayed so long due to one or the other reason.

That said, I am having it on my plate to investigate alloca stuff in generic (for LLVM) and some constraints towards it in AMDGPU backend, and to fix it as neat as possible. But, it will not be one or two days of task and I cannot hold on LDS for this alloca task to complete. 

Finally, as said, it is a temporary hack, and I will be removing it once I fix alloca stuff.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109594



More information about the llvm-commits mailing list