[PATCH] D102882: [AMDGPU] Fix module LDS selection

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 20 15:51:25 PDT 2021


rampitec added a comment.

In D102882#2772399 <https://reviews.llvm.org/D102882#2772399>, @JonChesterfield wrote:

> That is much prettier, thank you.
>
> We have the magic string "llvm.amdgcn.module.lds" in a few places now, might be worth putting that behind a function call. Separate to the above, if we do it at all.

Yeah, I think we need a function to return it or define.



================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp:67
   if (isModuleEntryFunction()) {
-    GlobalVariable *GV = M->getGlobalVariable("llvm.amdgcn.module.lds");
+    GlobalVariable *GV = M->getGlobalVariable("llvm.amdgcn.module.lds", true);
     if (GV) {
----------------
arsenm wrote:
> rampitec wrote:
> > arsenm wrote:
> > > getNamedGlobal?
> > Probably. But that's a different change I guess.
> No, that's the wrapper that passes true in for you
Ah, right.


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

https://reviews.llvm.org/D102882



More information about the llvm-commits mailing list