<div dir="ltr">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.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 23, 2017 at 2:06 PM, Rodney M. Bates via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am generating llvm code for nested procedures. Each one gets a static link,<br>
which I am passing as an internally added, first parameter. However, it needs<br>
to be stored in memory too, so a debugger can find it. So, when I need to use<br>
the value, is it better to use the ssl parameter or load the memory copy?<br>
<br>
I can imagine the ssl value might avoid unnecessary fetches, but then, it<br>
might also sometimes result in storage of a second copy in a memory temp.<br>
<br>
Also, do I need to do something to prevent the unused copy from being<br>
eliminated altogether?<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Rodney Bates<br>
<a href="mailto:rodney.m.bates@acm.org" target="_blank">rodney.m.bates@acm.org</a><br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</font></span></blockquote></div><br></div>