[PATCH] D52741: [AMDGPU] Add an AMDGPU pass to promote bitcast calls

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 1 12:05:03 PDT 2018


scott.linder created this revision.
scott.linder added reviewers: arsenm, rampitec, mssimpso.
Herald added subscribers: llvm-commits, t-tye, tpr, dstuttard, yaxunl, mgorny, nhaehnle, wdng, jvesely, kzhuravl.

AMDGPU only supports direct calls, but at lower optimization levels it fails to lower statically direct calls which appear indirect due to a bitcast, e.g. calls of the form `call ... bitcast (... @func to ...)(...)`

      

Update CallPromotionUtils to handle both bitcast and pointer cast of argument and return types and use it in an AMDGPU pass to promote all possible calls before inlining.


Repository:
  rL LLVM

https://reviews.llvm.org/D52741

Files:
  lib/Target/AMDGPU/AMDGPU.h
  lib/Target/AMDGPU/AMDGPUFixFunctionBitcasts.cpp
  lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  lib/Target/AMDGPU/CMakeLists.txt
  lib/Transforms/Utils/CallPromotionUtils.cpp
  test/CodeGen/AMDGPU/call-constexpr.ll
  test/CodeGen/AMDGPU/promote-alloca-bitcast-function.ll
  test/CodeGen/AMDGPU/unsupported-calls.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52741.167793.patch
Type: text/x-patch
Size: 12487 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181001/4de9c06e/attachment.bin>


More information about the llvm-commits mailing list