<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sat, Jun 17, 2017 at 11:20 AM 陳韋任 <<a href="mailto:chenwj.cs97g@g2.nctu.edu.tw">chenwj.cs97g@g2.nctu.edu.tw</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Documentation's a bit stale - it'd probably be enlightening/helpful to look at some real world examples, such as:<br><br>





<p class="m_6871999824673118610gmail-m_7091540453213658009inbox-inbox-p1"><span class="m_6871999824673118610gmail-m_7091540453213658009inbox-inbox-s1">%arrayidx = getelementptr inbounds i32*, i32** %0, i64 3<br><br>So the first argument (i32*) is a type, currently it's the same type as the type that the second argument points to (or, in the case of a vector gep, it's the type of the pointee of the elements of the vector argument).<br></span></p></div>
</blockquote></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​So you mean we actually have three arguments here, ​<span style="font-family:arial,sans-serif">i32*, i32** %0 and i64 3? </span></div></div></div></blockquote><div><br></div><div>Right, though I can see how that could be a bit unclear/uncertain. Is the first thing ('i32*') an argument, since it's only a type and no value? Dunno - I could see using a few different phrasings... but probably as good as any to refer to it as the first argument.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,sans-serif">The how about the following statement</span></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default"><span style="font-family:arial,sans-serif">    </span>The first index always indexes the pointer value given as the first argument</div><div class="gmail_default"><br></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_default">it should be</div><div class="gmail_default"><br></div><div class="gmail_default">    The first index always indexes the pointer value given as the second argument</div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​right?</div></div></div></blockquote><div><br>Yep, sounds right to me.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I am okay sending patch to fix the document, btw. :)</div></div></div></blockquote><div><br>Cool, thanks a bunch!<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Regards,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">chenwj​</div><br clear="all"><div><br></div>-- <br><div class="m_6871999824673118610gmail_signature"><div dir="ltr"><div>Wei-Ren Chen (陳韋任)<br>Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/~chenwj</a></div></div></div>
</div></div></blockquote></div></div>