[LLVMdev] eliminating dead functions
criswell at uiuc.edu
Mon Apr 5 09:37:25 PDT 2010
shreyas krishnan wrote:
> I am wondering if there is way to eliminate functions that are not
> used after two files have been linked. Can the optimizer do it ? Or is
> there a way you can have it done while linking it self ?
I think there's an LLVM optimization to do this; however, it should only
delete functions with internal linkage. Functions with external linkage
could be referenced and used by code that is linked in later.
The -internalize pass will change external functions to have internal
linkage, enabling this optimization.
-- John T.
> thanks for answers
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev