<div dir="ltr"><span style="font-size:12.8px">> Isn't Instruction* a pointer to the instruction in memory? If so, it'll change across runs</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Correct, but none of this is meant to be stored across runs, so the actual address doesn't matter. You recompute the map every time your IR is loaded.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 8, 2017 at 7:34 PM, Dipanjan Das 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"><div dir="ltr"><br><div class="gmail_extra"><span><br><div class="gmail_quote">On 8 May 2017 at 18:14, Jonathan Roelofs <span dir="ltr"><<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">An alternative way to do it, which would be less invasive and more upstreaming friendly, would be to implement this as an analysis pass.<br>
<br>
In the pass, calculate a map<Instruction*,ID>, and use that as the analysis result. Then query that result for the ID where you need it. If you've written the analysis correctly, then you'll always get the same IDs for the same instructions given the same input IR.<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="m_7197215919278991181m_-7522216622262952066m_-663593307792106280m_8276957317657551208HOEnZb"><font color="#888888">
</font></span></blockquote></blockquote></div><div class="gmail_extra"><br></div></span>Isn't Instruction* a pointer to the instruction in memory? If so, it'll change across runs.<span><br><br clear="all"><div><br></div>-- <br><div class="m_7197215919278991181m_-7522216622262952066m_-663593307792106280m_8276957317657551208gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span><div><div dir="ltr"><p>Thanks & Regards,</p>
<div>Dipanjan</div></div></div></span></div></div>
</span></div></div>
<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>
<br></blockquote></div><br></div></div>