Yuri
2010-Aug-29 18:35 UTC
[LLVMdev] How can I know which functions aren't used within one module?
Every value used in .ll file normally has '#uses=' printed next to it. But functions don't have this. Is there a way to make llvm to print uses of functions within the current module? Thank you, Yuri
Renato Golin
2010-Aug-30 09:20 UTC
[LLVMdev] How can I know which functions aren't used within one module?
On 29 August 2010 19:35, Yuri <yuri at rawbw.com> wrote:> Is there a way to make llvm to print uses of functions within the > current module?Hi Yuri, I was waiting for someone with more knowledge to answer that, but I guess you just need to write a pass that counts the number of 'call's to each function in each other function and global declarations, and maybe add uses to Functions. cheers, --renato
Duncan Sands
2010-Sep-02 08:54 UTC
[LLVMdev] How can I know which functions aren't used within one module?
Hi Yuri,> Every value used in .ll file normally has '#uses=' printed next to it. > But functions don't have this.I've added this. Ciao, Duncan.
Chris Lattner
2010-Sep-02 23:25 UTC
[LLVMdev] How can I know which functions aren't used within one module?
On Sep 2, 2010, at 1:54 AM, Duncan Sands wrote:> Hi Yuri, > >> Every value used in .ll file normally has '#uses=' printed next to it. >> But functions don't have this. > > I've added this.I just removed it :) In retrospect, having #uses come out of the asmprinter by default was a "bad thing", because it is just clutter and doesn't add much useful value. It is better to have people interested in this opt into it. Instead of being on by default, I reimplemented it as part of the llvm-dis tool. To get #uses info (including for functions) you can now run a .bc file through "llvm-dis -show-annotations". -Chris
Apparently Analagous Threads
- [LLVMdev] How can I know which functions aren't used within one module?
- [LLVMdev] Is the option --enable-shared discontinued in 2.7?
- [LLVMdev] Why clang inlines with -O3 flag and opt doesn't?
- [LLVMdev] Non-standard labels
- [LLVMdev] [PATCH] with no response: Bug 13163 - BlockAddress instruction with use from the global context is damaged during module link