<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Eric,<div class=""><br class=""></div><div class="">Thanks for sharing your thoughts on that feature.</div><div class=""><br class=""></div><div class="">FWIW, I am in favor of this work.</div><div class="">If you need some backend people to do reviews don’t hesitate to add me!</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">-Quentin<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 20, 2017, at 3:16 PM, Eric Christopher via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi All,<div class=""><br class=""></div><div class="">I've gotten a few notes over the last few months and also given some of the recent changes to various backends to "update" the default tunings for a generic processor it made me think again about adding support for tuning to a processor rather than generating processor specific code - hence, mtune. I hope this is rather uncontroversial, but happy to discuss at length if anyone thinks we shouldn't add this functionality to the compiler.</div><div class=""><br class=""></div><div class="">That said, I have a bit of a strawman outline for what I think needs to happen in general, and while I don't have any concrete plans to attack this soon I thought I'd post it in case someone else was interested:</div><div class=""><br class=""></div><div class=""><span style="color:rgb(33,33,33);font-size:13px" class="">a) split out (in targets where we care) code generation features from tuning features on a per subtarget basis into a separate set of features</span><br style="color:rgb(33,33,33);font-size:13px" class=""><span style="color:rgb(33,33,33);font-size:13px" class="">b) add support for initializing them based on a tune parameter to the subtarget</span><br style="color:rgb(33,33,33);font-size:13px" class=""><span style="color:rgb(33,33,33);font-size:13px" class="">c) add support to clang for generating the tune parameter on a per function basis</span><br style="color:rgb(33,33,33);font-size:13px" class=""></div><div class=""><span style="color:rgb(33,33,33);font-size:13px" class="">d) Use them in TTI and various other backend hooks rather than any code gen specific ones.</span></div><div class=""><span style="color:rgb(33,33,33);font-size:13px" class=""><br class=""></span></div><div class=""><span style="color:rgb(33,33,33);font-size:13px" class="">Simple right? :) I'm happy to elaborate here, but I believe the work is relatively straight forward if a lot of typing.</span></div><div class=""><span style="color:rgb(33,33,33);font-size:13px" class=""><br class=""></span></div><div class=""><span style="color:rgb(33,33,33);font-size:13px" class="">Every step there is likely to be a lot more complicated, but similar to the getSubtarget<>/getSubtargetImpl changes it should be very easy to do on any particular backend and fan out support there. Just make sure that clang knows which targets do and don't support the flag.</span></div><div class=""><br class=""></div><div class="">Happy to help or review work here.</div><div class=""><br class=""></div><div class="">Thanks!</div><div class=""><br class=""></div><div class="">-eric</div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>