<div dir="ltr">On Thu, Apr 17, 2014 at 12:33 PM, Jingyue Wu <span dir="ltr"><<a href="mailto:jingyue@google.com" target="_blank">jingyue@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">When emitting array subscripts, clang extends or truncate the index type to the size of a pointer (lib/CodeGen/CGExpr.cpp:2260). This code was added in a very initial commit. Is it still necessary given gep supports any-width integers as an array index (<a href="http://llvm.org/docs/LangRef.html#id180" target="_blank">http://llvm.org/docs/LangRef.html#id180</a>)? </div>
</blockquote><div><br></div><div>It is not necessary, in general. It is the form that the optimizer prefers, though the optimizer knows how to transform code to this form on its own. Having clang do it means the optimizer has less to do, though probably not a lot less.<br>
<br></div><div>Dan<br><br></div></div></div></div>