search for: deadfunctions

Displaying 7 results from an estimated 7 matches for "deadfunctions".

2015 May 19
2
[LLVMdev] Removing AvailableExternal values in GlobalDCE (was Re: RFC: ThinLTO Impementation Plan)
...lDCE.cpp =================================================================== --- lib/Transforms/IPO/GlobalDCE.cpp (revision 237590) +++ lib/Transforms/IPO/GlobalDCE.cpp (working copy) @@ -162,7 +162,10 @@ bool GlobalDCE::runOnModule(Module &M) { // themselves. for (unsigned i = 0, e = DeadFunctions.size(); i != e; ++i) { RemoveUnusedGlobalValue(*DeadFunctions[i]); - M.getFunctionList().erase(DeadFunctions[i]); + // Might have deleted the body of an available externally function that + // is still referenced. Leave the declaration. + if (DeadFunctions[i]->use_empt...
2015 May 19
2
[LLVMdev] Removing AvailableExternal values in GlobalDCE (was Re: RFC: ThinLTO Impementation Plan)
...=============================== >> --- lib/Transforms/IPO/GlobalDCE.cpp (revision 237590) >> +++ lib/Transforms/IPO/GlobalDCE.cpp (working copy) >> @@ -162,7 +162,10 @@ bool GlobalDCE::runOnModule(Module &M) { >> // themselves. >> for (unsigned i = 0, e = DeadFunctions.size(); i != e; ++i) { >> RemoveUnusedGlobalValue(*DeadFunctions[i]); >> - M.getFunctionList().erase(DeadFunctions[i]); >> + // Might have deleted the body of an available externally function >> that >> + // is still referenced. Leave the declarat...
2015 Jun 03
2
[LLVMdev] Removing AvailableExternal values in GlobalDCE (was Re: RFC: ThinLTO Impementation Plan)
...> --- lib/Transforms/IPO/GlobalDCE.cpp (revision 237590) >> >> +++ lib/Transforms/IPO/GlobalDCE.cpp (working copy) >> >> @@ -162,7 +162,10 @@ bool GlobalDCE::runOnModule(Module &M) { >> >> // themselves. >> >> for (unsigned i = 0, e = DeadFunctions.size(); i != e; ++i) { >> >> RemoveUnusedGlobalValue(*DeadFunctions[i]); >> >> - M.getFunctionList().erase(DeadFunctions[i]); >> >> + // Might have deleted the body of an available externally >> >> function >> >> that >...
2015 May 15
2
[LLVMdev] RFC: ThinLTO Impementation Plan
On Fri, May 15, 2015 at 9:18 AM, David Blaikie <dblaikie at gmail.com> wrote: > >> >> - Marking of imported functions (for use in ThinLTO-specific symbol >> >> linking and global DCE, for example). >> > >> > Marking how? Do you mean giving them internal linkage, or something >> > else? >> >> Mentioned just after this: either
2015 May 15
3
[LLVMdev] RFC: ThinLTO Impementation Plan
...d be demonstrated without ThinLTO and with a normal module with an available_externally function & would be worth discussing what the right behavior is in that context, regardless of ThinLTO. > > There was one other change to GlobalDCE that I had to make, where we > erase the list of DeadFunctions from the module. In my case we may > have a function body that was eliminated, but still have references to > it (i.e. in the case I am talking about above). In that case it is now > just a declaration and we don't erase it from the function list on the > module. If the GlobalsIsNee...
2017 Oct 26
2
LLVM v6.0 Internalize and GlobalDCE PASS can not work together?
Hi Hal, Thanks for your hint! $ /opt/llvm-svn/bin/opt -S -internalize -internalize-public-api-list=main -globaldce hello3.ll -o hello3.dce.ll    it works :) But I argue that `main` Function should be inserted into ExternalNames by default: Index: lib/Transforms/IPO/Internalize.cpp =================================================================== --- lib/Transforms/IPO/Internalize.cpp 
2017 Oct 25
3
LLVM v6.0 Internalize and GlobalDCE PASS can not work together?
Hi LLVM developers, $ cat hello.c #include <stdio.h> void foo() { } int main(int argc, char *argv[]) {   for (int i = 0; i < 10; i++) {     printf("%d\n", i);   }   return 0; } $ /opt/llvm-svn/bin/clang --version Fedora clang version 6.0.0 (trunk 316308) (based on LLVM 6.0.0svn) Target: x86_64-redhat-linux Thread model: posix InstalledDir: /opt/llvm-svn/bin $