https://bugs.llvm.org/show_bug.cgi?id=35534

            Bug ID: 35534
           Summary: Wasm backend duplicate function pruning
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedb...@nondot.org
          Reporter: n...@realvnc.com
                CC: llvm-bugs@lists.llvm.org

This is as a follow-on to COMDAT support
(https://bugs.llvm.org/show_bug.cgi?id=35533). I've split this out from bug
35533 because it's not a functional requirement; COMDAT works fine without this
refinement albeit with huge binaries.

Currently, our binary size is bigger than it need be, because duplicate
functions aren't removed.

For example, if two files both include the following code:


void __attribute__((weak)) weakFn() {}


then the output Wasm from LLD will include *both* definitions of weakFn (one
from each input file), even though relocations will ensure that all callers
only ever call the first-defined instance.

This is a result of LLD dumbly concatenating the code sections of each object
file. It should prune function definitions where the Symbol for the function is
actually defined in a different object file.

This will greatly reduce code bloat for weak symbols and COMDAT (inline)
function definitions.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to