<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 22, 2017 at 12:22 PM Robinson, Paul <<a href="mailto:paul.robinson@sony.com">paul.robinson@sony.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-2463419309055148723WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">(re-adding llvm-commits)<u></u><u></u></span></p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-2463419309055148723WordSection1">
<p class="MsoNormal">If this is motivated by SPGO issues - should it be using mergeDebugLocations, then (& thus only changing the location if they come from different basic blocks)?<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
</div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-2463419309055148723WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Well, you could consider it a merge of all the uses, but then it should also be merged with the insertion point, which is chosen to dominate the uses.</span></p></div></div></blockquote><div><br></div><div>Doesn't need to be merged with the insertion point, I don't think? Does this merge across basic blocks? or just raise the uses of a constant to the beginning of a single basic block?<br><br>If it does work across basic block, then yeah, merging the location may be insufficient (since the location could be the same but still be merging across basic blocks... - not sure what the best way to detect/handle that is)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-2463419309055148723WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">  Intuitively
 it seemed unlikely this would ever produce a real debug location.  (Also, in a sense this is an artificially generated instruction and from that perspective having no source location is also appropriate.)<u></u><u></u></span></p></div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-2463419309055148723WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Do you want us to pursue the extra bookkeeping?  I'm having a hard time imagining this coming up in the wild (i.e., not convinced it's worth the effort, but
 you're a lot better at that than I am).</span></p></div></div></blockquote><div><br>I'd guess at a macro that uses the same constant a few times (in which case they'll have the same location) or maybe a single line statement (with column info disabled) using the constant a few times/in a few places.<br><br>I'd think it'd be worth checking how this works for some simple cases with a single basic block, etc. Maybe seeing how often that such a merge would fire on a real codebase maybe, etc.<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-2463419309055148723WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--paulr<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
</div></div><div lang="EN-US" link="blue" vlink="purple"><div class="m_-2463419309055148723WordSection1"><p class="MsoNormal"><a href="https://reviews.llvm.org/D38088" target="_blank">https://reviews.llvm.org/D38088</a><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
</div>
</div>

</blockquote></div></div>