Utils: Add utility pass to lower ifuncs
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 2 Dec 2022 00:02:18 +0000 (19:02 -0500)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 18 Jan 2023 03:33:56 +0000 (22:33 -0500)
commite7cd42f8e4da1beed52f401dcf87d22d36a2c81c
tree69baf2fd37af141c90e5ea08cd91d46334bfc57f
parent76d3e1a4980ff64a69494087f0a094b90ad54dff
Utils: Add utility pass to lower ifuncs

Create a global constructor which will initialize a global table of
function pointers. For now, this is only used as a reduction technique
for llvm-reduce.

In the future this may be useful to support ifunc on systems where the
program loader doesn't natively support it.
12 files changed:
llvm/include/llvm/Transforms/Utils/LowerIFunc.h [new file with mode: 0644]
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 [new file with mode: 0644]
llvm/lib/Transforms/Utils/ModuleUtils.cpp
llvm/test/Transforms/LowerIFunc/ifunc-alias.ll [new file with mode: 0644]
llvm/test/Transforms/LowerIFunc/ifunc-nonsense-resolvers.ll [new file with mode: 0644]
llvm/test/Transforms/LowerIFunc/ifunc-program-addrspace.ll [new file with mode: 0644]
llvm/test/Transforms/LowerIFunc/ifunc-typed.ll [new file with mode: 0644]
llvm/test/Transforms/LowerIFunc/lower-ifunc.ll [new file with mode: 0644]