[PATCH] D107329: [AMDGPU] Ignore call graph node which does not have function info.

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 3 20:55:31 PDT 2021


rampitec accepted this revision.
rampitec added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp:73
+      // associated function is not a definition.
+      if (!CGN->getFunction() || CGN->getFunction()->isDeclaration())
+        continue;
----------------
hsmhsm wrote:
> rampitec wrote:
> > hsmhsm wrote:
> > > rampitec wrote:
> > > > What will happen if we have a call to a real function, but bitcasted/aliased? getFunction() will return nullptr, but the function is still reachable.
> > > We have not yet handled bitcasted/aliased function pointers. We have planned it as a separate patch. We definetely need to relook into it at that point. But, for now, this check is essentailly required. This is the root cause behind the openmp compile time issue reported at https://reviews.llvm.org/D103225.
> > I understand. But is it safe if we have a bitcast and you reenable the pass?
> If we have bitcast, then this pass will not reach those bitcasted functions. So, it will not replace any LDS used within those functions. Then LDS lowering pass will directly pack those LDS into a module struct which possibly results in unoptimized use of LDS but the program is safe.
OK, this is conservatively correct but suboptimal. That is what I wanted to know.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107329



More information about the llvm-commits mailing list