<div dir="ltr">Is there a way to set always a defined behavior here - for example that we will always one getelemntptr with complex index?<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-09-02 12:53 GMT+02:00 Anastasiya Ruzhanskaya <span dir="ltr"><<a href="mailto:anastasiya.ruzhanskaya@frtk.ru" target="_blank">anastasiya.ruzhanskaya@frtk.ru</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ok, thank you. I have also one question about getelementptr. In different versions of clang I see that sometimes array[i][i] is preceded by two getelementptr instructions and sometimes only by one - with an already complex index.<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-09-01 12:50 GMT+02:00 David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank">David.Chisnall@cl.cam.ac.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_4485775279863739484HOEnZb"><div class="m_4485775279863739484h5">On 1 Sep 2017, at 11:44, Anastasiya Ruzhanskaya via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hello,<br>
> I wonder if the getelementptr can have other successors than load, store in some other cases when I directly print or directly return the result. every time I would like to assign the result - it will have a load/store successor?<br>
> So, basically the overall question is to clarify the possible successors of getelementptr.<br>
<br>
</div></div>Any instruction that may take a pointer operand might be a user of a GEP.  For example, consider this C function:<br>
<br>
int x(struct S *s)<br>
{<br>
        y(&s->field);<br>
}<br>
<br>
Here, there will be a GEP to get the address of the field and then the user will be a call (or possibly invoke) instruction.<br>
<span class="m_4485775279863739484HOEnZb"><font color="#888888"><br>
David<br>
<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>