<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 24, 2015 at 6:43 PM, escha via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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="h5"><br><div><blockquote type="cite"><div>On Aug 24, 2015, at 11:10 AM, Jingyue Wu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr"><div>Hi, </div><div><br></div><div>As you may have noticed, since last year, we (Google's CUDA compiler team) have contributed quite a lot to the effort of optimizing LLVM for CUDA programs. I think it's worthwhile to write some docs to wrap them up for two reasons. </div><div>1) Whoever wants to understand or work on these optimizations has some detailed docs instead of just source code to refer to. </div><div>2) RFC on how to improve these optimizations so that other targets can benefit from them as well. They are currently mostly restricted to the NVPTX backend, but I see many potentials to generalize them. </div><div><br></div><div>So, I started from this overdue <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__docs.google.com_document_d_1momWzKFf4D6h8H3YlfgKQ3qeZy5ayvMRh6yR-2DXn2hUE_edit-3Fusp-3Dsharing&d=BQMFaQ&c=eEvniauFctOgLOKGJOplqw&r=szS1_DDBoKCtS8B5df7mJg&m=TggebUNOWYFU5W3tKpC_z1CkNT9MN05aBwWloSru2NI&s=vmPxp-RDJuf_ZN5X7LNlV10JwuHK5Pt1ljn96IenW-o&e=" target="_blank">design doc</a> on the straight-line scalar optimizations. I will send out more docs on other optimizations later. Please feel free to comment. </div><div><br></div><div>Thanks, </div><div>Jingyue</div></div></div></blockquote><br></div></div></div><div>Out of curiosity, is there any plan to make the NVPTX-originated passes (separateconstantoffsetfromgep, slsr, naryreassociate) more generic? They seem very specialized for the nVidia GPU addressing modes despite the generic names, and in my tests tend to pessimize our target more often than not for that reason.</div><div><br></div><div>It’d be really nice to have something more generic, and I might look into helping with that sort of thing in the future if it becomes important for us.</div><div><br></div><div>—escha</div></div><br></blockquote><div><br></div><div>To add to Jingyue's answer - the reason these passes are not more generic is very pragmatic - we've just optimized them for the NVIDIA targets we care about and can run extensive benchmarking on. There's absolutely no problem generalizing them if someone's interested - in fact, we'd be happy to see that happen. This is what open-source is for :) IIRC some of the optimization work was already generalized by the AMD backend folks, and more can be done for sure. While PTX has its specific characteristics, many of the general issues with GPU-oriented optimizations are common to other GPU architectures and can be generalized in IR level passes.</div><div><br></div><div>Eli</div><div><br></div><div> </div></div><br></div></div>