<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 6, 2015 at 3:38 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">It's an idea been thrown around in a few different threads (including Rafael's recent <a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141201/247285.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20141201/247285.html</a> and Chandler's <a href="http://llvm.org/viewvc/llvm-project?rev=226781&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=226781&view=rev</a> ) so I'm putting up my hand to volunteer to do the work & interested in getting a bit more feedback, thoughts on best approaches, timing, etc.<br><br>For some more detail: pointer types (i32*, %foo*, etc) complicate IR canonicalization. store + load should be the same instructions given the same number of bytes stored to memory, but instead we can have store float, store int, etc, etc. Another point Chandler made was that the bitcasts involved when a pointer isn't of the right type results in extra IR instructions we don't really need.<br></div></blockquote><div><br></div><div>FWIW: This is actually a real source of annoyance when doing value numbering/PRE/insertion based stuff.</div><div><br></div><div>Current GVN essentially inserts them willy nilly to get the right types in the right places when playing with loads/stores.</div><div>It also spends a bunch of time trying to look through them.</div><div><br></div><div>Essentially, it's just another instruction to walk that gives you nothing, but has to be "worked around" if it ended up in the wrong place, etc.</div><div><br></div><div>It's like GCC's NOP_EXPR.</div><div><br></div><div>Here's what happened in the GCC world because of this:</div><div><br>grep -i strip_nops *|wc -l<br></div><div>     229<br></div><div><br></div><div>It's essentially littered around the codebase</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br>So the general idea is that all pointers would just be called "ptr" (pointer? void*?).<br><br>Is this something everyone feels is the right direction? Any reason why it wouldn't be?<br><br>Beyond that, I'm trying to think about how to do this & I haven't hit on a terribly convincing way to do this incrementally. I could introduce the alternative form of "store" that provides the magic pointer type, then set about adding overloads (is that possible?) of any instruction consuming a pointer type, writing the usual LLVM regression tests as I go. Eventually, once this looks like it's functioning, I could start porting IRbuilder and Clang over to the new store operations & other sources of pointers. Then remove the old stuff.<br><br>Are IR instructions overloadable like this? If not, would it be worthwhile to introduce separate names for the typeless-pointer forms (gep_ptr, store_ptr, etc) as a temporary means to have both sets of semantics then rename them all back once the old ones are removed?<br><br>Other ideas/thoughts?<span class=""><font color="#888888"><br><br>- David</font></span></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>