Lower ifunc calls via a global table initialized by a constructor.
Declared in <llvm/Transforms/Utils/ModuleUtils.h>
bool
lowerGlobalIFuncUsersAsGlobalCtor(
Module& M,
ArrayRef<GlobalIFunc*> IFuncsToLower = {});
Replaces uses with indirect calls loaded out of a global table initialized in a global constructor. This will introduce one constructor function and adds it to llvm.global_ctors. The constructor will call the resolver function once for each ifunc.
Leaves any unhandled constant initializer uses as-is.
If IFuncsToLower is empty, all ifuncs in the module will be lowered. If IFuncsToLower is non-empty, only the selected ifuncs will be lowered.
The processed ifuncs without remaining users will be removed from the module.
True if any ifunc users could not be lowered and were left as-is.
| Name | Description |
|---|---|
| M | Module whose ifunc users are lowered. |
| IFuncsToLower | IFuncs to lower, or empty to lower all ifuncs in M. |