<div dir="ltr">Great, thank you!<div><br></div><div><br></div><div>-- Mikael</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/27 Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">How does r195812 look to you?<div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Tue, Nov 26, 2013 at 10:40 PM, Mikael Lyngvig <span dir="ltr"><<a href="mailto:mikael@lyngvig.org" target="_blank">mikael@lyngvig.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"><div>Would you mind phrasing the sentence?  I'm simply not yet knowledgeable enough about LLVM to be able to take all the many factors and issues into consideration.  I am like a baby learning to walk, not an expert.<br>


</div><div><br></div><div>The purpose of the patch is solely to avoid the possibly frequent experience that people gets confused when LLC complains about the first temporary being named %0.  There's no other purpose with the patch.  </div>

<span><font color="#888888">
<div><br></div><div><br></div><div>-- Mikael</div></font></span></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/27 Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This is still really not the right way to describe it. There's nothing special about the entry BB in this regard. Any BB without an explicit label gets an unnamed integer value assigned to it, and the counter is incremented.<div>



<br></div><div>-- Sean Silva</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 26, 2013 at 10:24 PM, Mikael Lyngvig <span dir="ltr"><<a href="mailto:mikael@lyngvig.org" target="_blank">mikael@lyngvig.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">So what if I add this exact sentence after the place where the LR states that temporaries begin at %0:<div>



<div><br></div><div>   <span style="font-family:arial,sans-serif;font-size:13px"> I</span><span style="font-family:arial,sans-serif;font-size:13px">f a function entry block does not have an explicit label, it will be assigned label “%0”, then the first unnamed temporary in that block will be “%1”, etc.</span></div>




<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div><font face="arial, sans-serif">If you accept this, there's a patch for it attached to this message:</font></div><div><font face="arial, sans-serif"><br>




</font></div><div><font face="arial, sans-serif"><div>diff --git a/docs/LangRef.rst b/docs/LangRef.rst</div><div>index 18d2c9c..5db1a14 100644</div><div>--- a/docs/LangRef.rst</div><div>+++ b/docs/LangRef.rst</div><div>@@ -128,7 +128,9 @@ lexical features of LLVM:</div>




<div> #. Unnamed temporaries are created when the result of a computation is</div><div>    not assigned to a named value.</div><div> #. Unnamed temporaries are numbered sequentially (using a per-function</div><div>-   incrementing counter, starting with 0).</div>




<div>+   incrementing counter, starting with 0). If a function entry block does</div><div><div>+   not have an explicit label, it will be assigned label "%0", then the</div><div>+   first unnamed temporary in that block will be "%1", etc.</div>




<div><br></div></div><div> It also shows a convention that we follow in this document. When</div><div> demonstrating instructions, we will follow an instruction with a comment</div></font></div><span><font color="#888888"><div>



<font face="arial, sans-serif"><br>
</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">-- Mikael</font></div><div><font face="arial, sans-serif"><br></font></div></font></span></div><div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">
2013/11/27 Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span><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"><br><br><div class="gmail_quote">On Tue, Nov 26, 2013 at 10:01 PM, Mikael Lyngvig <span dir="ltr"><<a href="mailto:mikael@lyngvig.org" target="_blank">mikael@lyngvig.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">You're absolutely right (from the LR, I just searched):<div><br></div><div>  For example, if a function entry block does not have an explicit label, it will be assigned label “%0”, then the first unnamed temporary in that block will be “%1”, etc. </div>






<div><br></div><div>This is under Functions.  I guess anybody should get that far, but I personally feel that the clarification I've submitted doesn't harm.</div><span><font color="#888888"><div><br>
</div></font></span></div></blockquote><div>Your current patch is inaccurate. If you want to duplicate what is mentioned elsewhere about the numbering to make it more likely that someone will see it, that would be OK.</div>





<div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span><font color="#888888"><div></div>
<div><br></div><div>-- Mikael</div></font></span></div><div><div>
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/27 Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div dir="ltr">It is correct as written. Unnamed BB's are "unnamed temporaries" from a counting perspective. If the first BB is unlabeled, then it becomes %0. The first instruction then becomes %1, etc.<div>






<br>
</div><div>I swear we mention that somewhere in LangRef (I seem to recall reviewing a patch mentioning that), but if not, a patch mentioning that would be fine.<div><br></div><div>-- Sean Silva</div></div></div><div class="gmail_extra">







<br><br><div class="gmail_quote">On Tue, Nov 26, 2013 at 8:50 PM, Mikael Lyngvig <span dir="ltr"><<a href="mailto:mikael@lyngvig.org" target="_blank">mikael@lyngvig.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">This patch adds the following sentence to the LR after it states that temporaries begin at index 0:<div><br><div>   If you do not specify a label for the entry block, the temporaries start at index 1 as index<br>








</div><div>   0 is then used for an implicit label generated by LLVM.</div><div><br></div><div>This because LLC complains when you use %0 as a temporary and there is no entry point label in the function.  Then you get an error message, which can be quite difficult to figure out why.</div>








</div><div><br></div><div>If this patch is rejected, somebody should probably phrase the above appropriately and submit a new patch.</div><span><font color="#888888"><div><br></div><div><br></div><div>-- Mikael</div>
<div><br></div></font></span></div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></div><br></div>