<div dir="ltr"><div dir="ltr">Hi Liqiang,<div><br></div><div>Jakub's recommendations are great and they reminded me of one of the talks we gave in the last LLVM conf: <a href="https://youtu.be/I4Iv-HefknA?t=1081">https://youtu.be/I4Iv-HefknA?t=1081</a></div><div>In this part about inlining, in the end I have a "further reading" section that you might find interesting (note that slides are available in the YT comments).</div><div>Some of the papers that Jakub mentioned are there and some more that you may find useful.</div><div><br></div><div>Hopefully, the rest of the part will help you understand LLVM's inlining a little better too. Unfortunately, when I was preparing this part, a lot of content had to be thrown</div><div>out as the part ended up being a talk by itself. The reason I'm mentioning that is to motivate you to please ask questions if you want! There is a lot of content<br></div><div>about inlining in LLVM that has not been presented anywhere and although I'm no expert on inlining, I'll try to help. And I hope the rest of the community will do too.</div><div><br></div><div>Best,</div><div>Stefanos</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Στις Δευ, 8 Φεβ 2021 στις 9:58 μ.μ., ο/η Jakub (Kuba) Kuderski via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> έγραψε:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Liqiang,<br><br>Here are some papers that may be loosely related to the problem you described, without any particular order:<br><br>1. Automatic construction of inlining heuristics using machine learning, Sameer Kulkarni et al., 2013  <a href="https://dl.acm.org/doi/10.1109/CGO.2013.6495004" target="_blank">https://dl.acm.org/doi/10.1109/CGO.2013.6495004</a><br>2. Adaptive online context-sensitive inlining, Kim Hazelwood, David Grove, 2003  <a href="http://www.cs.cmu.edu/afs/cs/academic/class/15745-s07/www/papers/hazelwood-cgo03.pdf" target="_blank">http://www.cs.cmu.edu/afs/cs/academic/class/15745-s07/www/papers/hazelwood-cgo03.pdf</a><br>3. An Adaptive Strategy for Inline Substitution, Keith Cooper et al., 2008  <a href="https://link.springer.com/chapter/10.1007/978-3-540-78791-4_5" target="_blank">https://link.springer.com/chapter/10.1007/978-3-540-78791-4_5</a><br>4. Automatic Tuning of Inlining Heuristics, John Cavazos, Michael F.P. O’Boyle, 2005  <a href="https://www.eecis.udel.edu/~cavazos/cpc-2006.pdf" target="_blank">https://www.eecis.udel.edu/~cavazos/cpc-2006.pdf</a><div>5. Towards Better Inlining Decisions Using Inlining Trials, Jeffrey Dean, Craig Chambers, 1994  <a href="https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.50.1043&rep=rep1&type=pdf" target="_blank">https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.50.1043&rep=rep1&type=pdf</a></div><div>6. Exploiting Hardware Performance Counters with Flow and Context Sensitive Profiling, Glenn Ammons et al., 1997  <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.45.2010" target="_blank">http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.45.2010</a><br>7. Boosting Inlining Heuristics, Nuno Lopes, 2010  <a href="https://web.ist.utl.pt/nuno.lopes/pubs/inline-stats10.pdf" target="_blank">https://web.ist.utl.pt/nuno.lopes/pubs/inline-stats10.pdf</a><br><br>-Jakub</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 8, 2021 at 8:26 AM Liqiang Tao via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">To Whom it May Concern,<br><br>I am Liqiang Tao, a graduate student in the Graduate School of Arts and Sciences of the University of Tokyo.<br><br>First, I would like to talk about my interests here. When I saw the Open Projects page, I was attracted by this area.<br><br><div>> Moreover, we want to explore the case that is helpful to group strongly related functions together and optimize them as a group instead of displaying them individually. I consider whether it is possible to inline some related methods to improve performance. <br></div><div><br></div><div>Then I found a paper[1]. In this paper, the methods are inlined by clusters rather than individuals. The profile and IR size are applied to decide inline or not. I also noticed that the profile directed inlining, as a todo item, also appears in the Open Projects page. It might be a nice start, right?<br></div><br>Besides, if possible, I am also interested in applying inter-procedural analysis or static analysis to guide inlining. Unfortunately, I didn't find any paper about this idea. Could you please provide me with some suggestions about this? Is there any process related to these ideas in LLVM?<br><br>As for my background relevant to this project:<br>* I am participating in porting V8 to RISC-V from July, 2020.<br><a href="https://github.com/v8-riscv/v8" target="_blank">https://github.com/v8-riscv/v8</a><br>* Recently, I began learning the inliner code in LLVM. And I also tried to create my own pass to be familiar with LLVM infrastructure.<br><br>Looking forward to more discussions,<br><br>Best Wishes,<br>Liqiang Tao<br><br>[1] An Optimization-Driven Incremental Inline Substitution Algorithm for Just-In-Time Compilers<br><a href="https://dl.acm.org/doi/10.5555/3314872.3314893" target="_blank">https://dl.acm.org/doi/10.5555/3314872.3314893</a></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Jakub Kuderski</div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>