<div dir="ltr">Thanks for the feedback! I really appreciate it, especially the `don't show` part :-P<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 17, 2021 at 6:44 PM Nuno Lopes <<a href="mailto:nunoplopes@sapo.pt">nunoplopes@sapo.pt</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 style="overflow-wrap: break-word;" lang="EN-US"><div class="gmail-m_-2182558642227217021WordSection1"><p class="MsoNormal">GVN is super interesting, yes. Well worth the time.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I would add an SSA-construction algorithm (SROA in LLVM, but you can go with something simpler). Understanding SSA construction requires other concepts, such as dominators, and is an eye-opener for some of the tradeoffs being done in IR design (caching reaching-defs information).<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I would also try a simple static analysis, like range analysis, so students understand the concepts of abstract interpretation, abstraction, widening, etc. You can introduce SSI here if you have time.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Alias analysis is important. But don<span style="font-family:"Times New Roman",serif">’</span>t show LLVM<span style="font-family:"Times New Roman",serif">’</span>s one <span style="font-family:"Segoe UI Emoji",sans-serif">😅</span>  I think gcc<span style="font-family:"Times New Roman",serif">’</span>s is probably a better example. This combined with some simple optimizations that it enables, like store forwarding.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Linear-scan register allocation is simple and I think it<span style="font-family:"Times New Roman",serif">’</span>s important to see the last mile. As well as a simple instructions election algorithm. The Burg family ones are not complicated.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">In the end, more than learning many algorithms, I think the point is that they should realize how large programs are and how quick the compiler must be to handle those. So it<span style="font-family:"Times New Roman",serif">’</span>s all about doing the right tradeoffs of compilation speed vs benefit in performance/code-size/etc. Spend some time looking at the output of the compiler, both IR & assembly, and discuss in class what could be improved. It<span style="font-family:"Times New Roman",serif">’</span>s fascinating.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">If your students learn all of this, please send them in for internships <span style="font-family:"Segoe UI Emoji",sans-serif">😊</span><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Nuno<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm"><p class="MsoNormal"><b>From:</b> Wei Wu<u></u><u></u></p><p class="MsoNormal"><b>Sent:</b> 17 February 2021 10:22<br><b>To:</b> llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br><b>Subject:</b> [llvm-dev] [Education] Call for suggestion: Which algorithms/passes you want a new LLVM developer to know<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">Hi,<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I'm preparing a new compiler course which will start in April. The course uses LLVM as the reference compiler and RISC-V as the backend. The goal of the course is to bring up new compiler developers for LLVM and other toolchains. I propose to introduce ten or eleven algorithms that are commonly used in modern compiler systems, and walk-through the source code of these algorithms in LLVM codebase. Although I have several textbooks in my hand, I am not sure which algorithms are expected to be familiar for a new compiler developer. Currently tablegen, GlobalISel, GVN, DCE, and Inlining are in the plan, and there are still a few algorithms to be filled in.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I appreciate it if you can provide some suggestions. <u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><br>-- <u></u><u></u></p><div><p class="MsoNormal">Best wishes,<br>Wei Wu (<span style="font-family:"MS Gothic"">吴</span><span style="font-family:"Microsoft JhengHei",sans-serif">伟</span>)<u></u><u></u></p></div></div></div></div></div></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Best wishes,<br>Wei Wu (吴伟)<br></div>