[PATCH] D155884: [Attributor][AMDGPU] Improve indirect call support in closed modules

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 14:01:24 PDT 2023


jdoerfert created this revision.
jdoerfert added reviewers: arsenm, jhuber6, tianshilei1992.
jdoerfert added a project: AMDGPU.
Herald added subscribers: hoy, ormris, foad, okura, kuter, kerbowa, bollu, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a reviewer: homerdin.
Herald added a project: All.
jdoerfert requested review of this revision.
Herald added subscribers: llvm-commits, jplehr, sstefan1, wdng.
Herald added a reviewer: sstefan1.
Herald added a project: LLVM.

If we see all functions that can be called, thus in a "closed module",
we can perform better reasoning in the presence of unknown callees of
indirect calls. We now collect all indirectly callable functions, and
match them against an indirect call site with an unknown callee. Every
function that is a candidate is potentially called.

The AMDGPU backend is the only user for now. We should enable this for
AMDGPU (and NVIDIA GPUs in certain cases) also when we run the
Attributor (or OpenMP-opt) earlier in the pipeline.

TODOs

- We should also set the !callee attribute.
- We should improve the "is candidate" logic.


https://reviews.llvm.org/D155884

Files:
  llvm/include/llvm/Transforms/IPO/Attributor.h
  llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/lib/Transforms/IPO/AttributorAttributes.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-indirect-call.ll
  llvm/test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll
  llvm/test/CodeGen/AMDGPU/attributor-loop-issue-58639.ll
  llvm/test/CodeGen/AMDGPU/direct-indirect-call.ll
  llvm/test/CodeGen/AMDGPU/duplicate-attribute-indirect.ll
  llvm/test/CodeGen/AMDGPU/indirect-call.ll
  llvm/test/CodeGen/AMDGPU/simple-indirect-call.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155884.542665.patch
Type: text/x-patch
Size: 33422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230720/b2e2605f/attachment.bin>


More information about the llvm-commits mailing list