<div dir="ltr"><div class="gmail_extra">

<span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">> LICM's behavior seems reasonable/desirable to me. I've shared my thoughts on<span> </span></span><a href="http://llvm.org/PR37682" rel="noreferrer" target="_blank" style="color:rgb(17,85,204);font-size:small;background-color:rgb(255,255,255)">llvm.org/PR37682</a><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">. To summarize, I don't think it's feasible to assert that the debugger show updated values for 'total' within this loop, because it </span></div><div class="gmail_extra"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">> amounts to a demand that LICM never happen. Alternatives such as marking 'total' as unavailable, or making it appear as a non-pointer type, have serious tradeoffs and/or can't properly model the effects of aliasing.</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">

<br></div><div class="gmail_extra">Thanks for taking a look.  Let's continue the discussion if there's any more follow-up in the bug to prevent derailing this thread.  I agree with everything you say, but it still makes me feel uneasy that we have a situation where we have the information available according to the semantics of the code the user wrote (that "total" gets updated on every iteration, where we have that value in a register) but we aren't able to present that to the user because it conflicts with the reality of the optimized code ("total" is a memory location that has the value 0 until the loop terminates when the contents of the register are stored to it).  I'd love a third option where we could somehow convey that information to the user.  If that's not an option currently, we should consider a solution for -Og mode at least.  As I mentioned in the bug, we come across poorly compared to MSVC here in terms of quality of debugging, but vaguely amusingly purely because it doesn't appear to hoist the store.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-Greg</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 5 June 2018 at 23:17, Vedant Kumar <span dir="ltr"><<a href="mailto:vsk@apple.com" target="_blank">vsk@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Greg,<br>
<span class=""><br>
> On Jun 4, 2018, at 2:18 PM, Greg Bedwell via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> <br>
> FWIW, I've raised the LICM issue here: <a href="https://bugs.llvm.org/show_bug.cgi?id=37682" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_<wbr>bug.cgi?id=37682</a><br>
<br>
</span>LICM's behavior seems reasonable/desirable to me. I've shared my thoughts on <a href="http://llvm.org/PR37682" rel="noreferrer" target="_blank">llvm.org/PR37682</a>. To summarize, I don't think it's feasible to assert that the debugger show updated values for 'total' within this loop, because it amounts to a demand that LICM never happen. Alternatives such as marking 'total' as unavailable, or making it appear as a non-pointer type, have serious tradeoffs and/or can't properly model the effects of aliasing.<br>
<span class="HOEnZb"><font color="#888888"><br>
vedant<br>
</font></span><span class="im HOEnZb"><br>
> <br>
> On 31 May 2018 at 13:28, Anast Gramm <<a href="mailto:anastasis.gramm2@gmail.com">anastasis.gramm2@gmail.com</a>> wrote:<br>
> Thanks,<br>
> These are very helpful.<br>
> <br>
> As I understand it, SROA and LICM render some variables<br>
> "useless" by optimizing the code to not use them. Hence we can't debug them.<br>
> <br>
> <br>
</span><div class="HOEnZb"><div class="h5">> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">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>
</div></div></blockquote></div><br></div></div>