<div dir="ltr">Can we go back a little?<div class="gmail_extra"><br><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"><span style="font-size:12.8px">1) Add a new transformation to InstCombine that will replace 'getelementptr i8, i8* null, <ty> %n' with 'inttoptr <ty> %n to i8*' when <ty> has the same size as a pointer for the target architecture.</span></blockquote><div><br></div><div>What's the actual problem with this approach? I personally find it the most compelling - it is well-defined (well, somewhat), front-end agnostic (and assume some front ends may find this kind of pointer arithmetic to be well-defined) and predictable. </div><div>I would even extend it to allow offsets of different types to be used, with additional zero-extension when applicable.</div><div><br></div><div>Cheers,</div><div>Marcin</div></div>
</div></div>