<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 22, 2014 at 4:42 PM, Louis Gerbarg <span dir="ltr"><<a href="mailto:lgg@apple.com" target="_blank">lgg@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":50a" class="a3s" style="overflow:hidden">The problem that the above transform is technically illegal because “When indexing into a (optionally packed) structure, only i32 integer constants are allowed (when using a vector of indices they must all be the same i32 integer constant).” rule <<a href="http://llvm.org/docs/LangRef.html#getelementptr-instruction" target="_blank">http://llvm.org/docs/LangRef.html#getelementptr-instruction</a>>.</div>
</blockquote></div><br>Wait, I don't follow. You don't violate this rule. The first index in GEP is *not* into the structure, it is along the implicit array of objects that any pointer refers to. Thus the i64 operand to the first GEP selects a different struct object in an array of them, and the first i64 operand to the second GEP re-selects the same struct object but then uses an i32 index into it. </div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Perhaps you need a better example to show the illegal transform? That would help me understand the rest of your problem.</div></div>