[llvm-dev] Advise on which copy to use.

Reid Kleckner via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 24 08:38:53 PDT 2017


I'd recommend storing the link parameter in memory and loading from it at
the first use in every basic block. This should give you the best variable
tracking debug info after optimization, because LLVM will insert
@llvm.dbg.value calls at the point of each load, and you won't have to do
that yourself.

On Sun, Jul 23, 2017 at 2:06 PM, Rodney M. Bates via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> I am generating llvm code for nested procedures.  Each one gets a static
> link,
> which I am passing as an internally added, first parameter.  However, it
> needs
> to be stored in memory too, so a debugger can find it.  So, when I need to
> use
> the value, is it better to use the ssl parameter or load the memory copy?
>
> I can imagine the ssl value might avoid unnecessary fetches, but then, it
> might also sometimes result in storage of a second copy in a memory temp.
>
> Also, do I need to do something to prevent the unused copy from being
> eliminated altogether?
>
> --
> Rodney Bates
> rodney.m.bates at acm.org
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170724/d86463c0/attachment.html>


More information about the llvm-dev mailing list