[PATCH] D49622: ELF: Make sections with KeepUnique bit eligible for ICF.

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 23 05:28:08 PDT 2018


On Mon, 23 Jul 2018 at 13:17, ben via Phabricator via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
> bd1976llvm added a comment.
>
> Hi Peter,
>
> Thanks for your address significance tables work!
>
> Specific to this change:
>
> I was under the impression that the intention of --keep-unique was to prevent *all* folding?

+1

One of the uses of keep-unique that I am aware of is to implement
various kinds of communication protocols with the debugger. E.g. the
gdb jit interface
<https://www-zeuthen.desy.de/unix/unixguide/infohtml/gdb/Declarations.html#Declarations>
expects the debugger to place a breakpoint on a function with a
predefined name. Since that function doesn't do anything when the
debugger is not present, it is typically empty. If the linker decides
to merge that function with another hot empty function, it can result
in the jit breakpoint being hit more times than needed. Since
processing a breakpoint hit takes a long time, this can make a debug
session unusable (even if the process under debug doesn't do any kind
of jitting).


More information about the llvm-commits mailing list