Ok, thanks. <br><br>I'm just curious since when I'm doing the calculations, I need to make sure all operands are of the same size. So I suppose I will simply pick the largest width.<br><br><div class="gmail_quote">
On Mon, Dec 12, 2011 at 5:25 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com">rjmccall@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 style="word-wrap:break-word"><div><div class="im"><div>On Dec 12, 2011, at 5:15 PM, John Criswell wrote:</div><blockquote type="cite">
<div bgcolor="#FFFFFF" text="#000000">
On 12/12/11 7:00 PM, Ryan Taylor wrote:
<blockquote type="cite">
So in this example:<br>
<br>
<pre>%idx = getelementptr { float*, i32 }* %MyStruct, i64 0, i32 1
<font><font size="4">Why is it picking i64 for the index but i32 for the offset? </font></font>
</pre>
</blockquote>
<br>
I believe pointers and arrays are indexed using i64 (or some integer
size matching the pointer size) and structure elements are indexed
using i32.<br></div></blockquote><div><br></div></div>This. Frontends generally emit non-struct indexes as appropriately-sized integers to avoid (possibly) unwanted problems with extension. In this case, since that index is constant 0, it's unimportant, but you can imagine cases where it would. Struct indexes, on the other hand, must be constant and non-negative, so the choice of index width doesn't matter.</div>
<span class="HOEnZb"><font color="#888888"><div><br></div><div>John.</div></font></span></div>
</blockquote></div><br>