[PATCH] D139163: Utils: Add utility pass to lower ifuncs

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 17:56:20 PST 2022


arsenm created this revision.
arsenm added reviewers: MaskRay, aeubanks, erichkeane, MoritzS, ibookstein, dexonsmith, tejohnson.
Herald added subscribers: kosarev, StephenFan, hiraditya, tpr.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

This can be used to support ifunc on systems where the program loader
doesn't natively support it.

      

Create a global constructor which will initialize a global table of
function pointers. For AMDGPU, ideally we would have a host-side
resolver function, but failing that, we can have a device side
constructor.

      

Switch funcs to global constructor


https://reviews.llvm.org/D139163

Files:
  llvm/include/llvm/Transforms/Utils/LowerIFunc.h
  llvm/include/llvm/Transforms/Utils/ModuleUtils.h
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Passes/PassRegistry.def
  llvm/lib/Transforms/Utils/CMakeLists.txt
  llvm/lib/Transforms/Utils/LowerIFunc.cpp
  llvm/lib/Transforms/Utils/ModuleUtils.cpp
  llvm/test/Transforms/LowerIFunc/ifunc-alias.ll
  llvm/test/Transforms/LowerIFunc/ifunc-constantexpr.ll
  llvm/test/Transforms/LowerIFunc/ifunc-nonsense-resolvers.ll
  llvm/test/Transforms/LowerIFunc/ifunc-program-addrspace.ll
  llvm/test/Transforms/LowerIFunc/ifunc-typed.ll
  llvm/test/Transforms/LowerIFunc/lower-ifunc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139163.479491.patch
Type: text/x-patch
Size: 30751 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221202/c1dcf8d2/attachment-0001.bin>


More information about the llvm-commits mailing list