<div dir="ltr">Hi 

Konstantin,<div><br></div><div>Let me try to help with the last two questions:</div><div>1) From what I understand, you don't have much experience with LLVM (or compilers in general? in such a case, I can recommend more stuff). Given that, I'd start with these two videos<br>a) <a href="https://www.youtube.com/watch?v=m8G_S5LwlTo" target="_blank">https://www.youtube.com/watch?v=m8G_S5LwlTo</a></div><div>b) <a href="https://www.youtube.com/watch?v=3QQuhL-dSys" target="_blank">https://www.youtube.com/watch?v=3QQuhL-dSys</a></div><div><br></div><div>These cover fundamental concepts and you'll have to know most of them no matter what you do in LLVM.</div><div>The next step depends on what you like. I'd say you could either play with an already existing pass or create your own.</div><div><br></div><div>Personally, I would go with the second although it seems more difficult (but it's not). First, because already existing passes</div><div>are production quality, which means that they contain a lot of stuff that are not exactly educational and would not be good for a beginner IMO.</div><div>(so for example, if I were to start with an already existing pass, I'd start with one implemented for a course or sth)</div><div>Second, because by creating your own pass, you will see sort of how everything fits together much faster.</div><div><br></div><div>Now, the problem with creating your own pass is that most relevant tutorials out there, either they use the old pass manager</div><div>or they make an out-of-tree pass (or both). The result is that you have to deal with a monstrosity of irrelevant (at least for now) things.</div><div><br></div><div>So, I'll go ahead and recommend something else: Just delete the code of an already existing pass and start over :) In particular,</div><div>find the ::run function and just delete what it does and call your own functions. For example, take this [4] and replace it with e.g. this</div><div><a href="https://pastebin.com/PhMLvMH7">https://pastebin.com/PhMLvMH7</a><br></div><div><br></div><div>You can now call "your" pass by adding -passes="loop-distribute" in the `opt` tool.</div><div><br></div><div>This should give you enough knowledge of the infrastructure to e.g. program a dominators pass [5] (if you don't know about dominators,</div><div>it's important that you learn about them, however, wikipedia is not a good source. I'd pick a book like "Engineering a Compiler").</div><div><br></div><div>2) I would start with those two:</div><div><br></div><div>a) CppCon 2016: Timur Doumler “Want fast C++? Know your hardware!" [1] </div><div>b) Writing cache friendly C++ - Jonathan Müller - Meeting C++ 2018 [2] <a href="https://www.youtube.com/watch?v=Nz9SiF0QVKY">https://www.youtube.com/watch?v=Nz9SiF0QVKY</a></div><div><br></div><div>If you want to go more in depth, you can watch this course [3] from CMU on Comp. Arch., I think it's amazing. You can cherry pick topics if you want.</div><div><br></div><div>Hope this helps, let me know if there are other questions.</div><div><br></div><div>- Stefanos</div><div><br></div><div>[1] <a href="https://www.youtube.com/watch?v=BP6NxVxDQIs">https://www.youtube.com/watch?v=BP6NxVxDQIs</a>

</div><div>[2] <a href="https://www.youtube.com/watch?v=Nz9SiF0QVKY">https://www.youtube.com/watch?v=Nz9SiF0QVKY</a><br></div><div>[3] <a href="https://www.youtube.com/playlist?list=PL5PHm2jkkXmi5CxxI7b3JCL1TWybTDtKq">https://www.youtube.com/playlist?list=PL5PHm2jkkXmi5CxxI7b3JCL1TWybTDtKq</a></div><div>[4] <a href="https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Scalar/LoopDistribute.cpp#L1043">https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Scalar/LoopDistribute.cpp#L1043</a></div><div>[5] <a href="https://en.wikipedia.org/wiki/Dominator_(graph_theory)#Algorithms">https://en.wikipedia.org/wiki/Dominator_(graph_theory)#Algorithms</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Στις Τρί, 19 Ιαν 2021 στις 5:05 π.μ., ο/η Сидоров , Константин Сергеевич 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">Dear all,<br><br>My name is Konstantin Sidorov, and I am a graduate student in Mathematics at Moscow Institute of Physics and Technology.<br><br>I would like to work on a project "Machine learning and compiler optimizations: using inter-procedural analysis to select optimizations" during the Google Summer of Code 2021.<br><br>I have an extensive background relevant to this project - in particular:<br><br>* I have already participated in GSoC before in 2017 with mlpack organization on the project "Augmented RNNs": <a href="https://summerofcode.withgoogle.com/archive/2017/projects/4583913502539776/" target="_blank">https://summerofcode.withgoogle.com/archive/2017/projects/4583913502539776/</a><br>* In 2019 I have graduated from the Yandex School of Data Analysis — a two-year program in Data Analysis by Yandex (the leading Russian search engine); more info on the curriculum could be also found at <a href="https://yandexdataschool.com/" target="_blank">https://yandexdataschool.com/</a>.<br>* I have also been working as a software engineer at Adeptik from July 2018 to date, where I have predominantly worked on projects on applied combinatorial optimization problems, such as vehicle-routing problems or supply chain modeling. In particular, I have had experience with both metaheuristic algorithms (e.g., local search or genetic algorithms) and more "traditional" mathematical modeling (e.g., linear programming or constraint programming).<br><br>I would like to discuss this project in more detail. While it is hard to discuss any kind of exact plan at this stage, I already have two questions concerning this project: <br><br>(1) I have set up an LLVM dev environment, but I am unsure what to do next. Could you advise me on any simple (and, preferably, relevant) tasks to work on?<br>(2) Could you suggest any learning materials to improve the understanding of "low-level" concepts? (E.g., CPU concepts such as caching and SIMD)<br><br>Best regards,<br>Konstantin Sidorov<br></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>