<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><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="gmail-m_7091540453213658009inbox-inbox-p1"><span class="gmail-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 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? The how about the following statement</span></div><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 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 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 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="gmail_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>