<div dir="ltr">This is great, thank you so much! I don't have mastery over the basics yet. I have read them and conceptually I understand them but I am afraid I can't write them on my own. I also appreciate your sharing <a href="http://godbolt.org">godbolt.org</a>. That is a great help. Do you know how I can learn about differences between IRs when optimizing is turned on vs. when it is not turned on? If there are many people on this list who might be interested in this topic then we can remove spamming everyone on this list by including llvm-dev. You guys decide. <br><div><br></div><div>Thanks.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 9, 2021 at 4:56 PM Stefanos Baziotis <<a href="mailto:stefanos.baziotis@gmail.com">stefanos.baziotis@gmail.com</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">Hi Mihir,<div><br></div><div>I'm not really sure what would be the best choice given that you mention that you want a source that covers LLVM IR "in depth" while previously it seemed you needed</div><div>a beginner-like source.</div><div><br></div><div>If you already know the basics, i.e.,:</div><div>- IR Structure (Module -> Function -> Basic Block -> Instruction)</div><div>- Basic operations (arithmetic, branches, calls, loads/stores, conversions all that)</div><div>- Intrinsics / Metadata</div><div>- PHIs</div><div>- GEPs</div><div>- What role types play in general</div><div><br></div><div>Bear in mind that when I mention these basics, I don't mean just knowing sort of what they do. I also mean how knowing sort of how can you use them as</div><div>building blocks to implement high level operations, e.g., (from simple to more complicated):</div><div>- 1 + 2 + 3</div><div>- function calls</div><div>- if-else if-else <br></div><div>- classes / structs and operations in them</div><div>- virtual functions</div><div><br></div><div>Maybe type conversions, pointers etc. anyway you get the point.</div><div><br></div><div>If you do have the basics down, _then_ I think is the time to start studying in depth. At this point, I don't think a book or any such source would be useful to you. LangRef would be the way to go along</div><div>with writing C++ in godbolt (<a href="https://godbolt.org/" target="_blank">https://godbolt.org/</a>) and seeing what LLVM IR Clang emits (with -emit-llvm and preferably -g0 to avoid debug info as cmd args).</div><div><br></div><div>But if you don't have the basics down, then you probably don't need something in-depth. In this case, I'd start with this video: <a href="https://www.youtube.com/watch?v=m8G_S5LwlTo" target="_blank">https://www.youtube.com/watch?v=m8G_S5LwlTo</a>,</div><div>writing (simple) C code in godbolt and inspecting the result (eventually trying to produce it myself) and maybe I'd watch a compilers course (meaning 1-2 lectures covering things</div><div>of interest, not the whole thing and without paying - there is plenty of free material from universities online).</div><div><br></div><div>I hope this helps. If not, maybe you can try to direct us on what exactly is your level.</div><div><br></div><div>Best,</div><div>Stefanos</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Στις Κυρ, 10 Ιαν 2021 στις 2:39 π.μ., ο/η Mihir Sevak via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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">Ok, thanks for the reply. Lets see what other folks have to say.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 9, 2021 at 4:37 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</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">Yeah, sorry - I haven't read any LLVM books, unfortunately. Perhaps some other folks will be able to chime in with tips.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 9, 2021 at 4:36 PM Mihir Sevak <<a href="mailto:mihir.sevak@gmail.com" target="_blank">mihir.sevak@gmail.com</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">I own this book and it doesn't cover IR in depth. I am trying to write an additional feature for C++ frontend and for that I want to use proper Intermediate Representation that doesn't become a laughing stock so I am looking for some in depth explanation on IR. I am aware that it changes so fast that a book will become outdated however for my exercise I am willing to go back to the version the book covers and implement it there. If you have used some book personally and recommend it please share with me.<div><br></div><div>Thanks. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 9, 2021 at 4:31 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</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">Published books probably get out of date pretty quickly, so you'll need to keep the more up-to-date code/online docs in mind even if you're reading printed stuff. At a quick google this seems like the sort of thing that might be useful: <a href="https://www.amazon.com/Getting-Started-LLVM-Core-Libraries/dp/1782166920" target="_blank">https://www.amazon.com/Getting-Started-LLVM-Core-Libraries/dp/1782166920</a> (googling 'llvm book' shows a few results)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 9, 2021 at 4:24 PM Mihir Sevak <<a href="mailto:mihir.sevak@gmail.com" target="_blank">mihir.sevak@gmail.com</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">Thanks David. Really appreciate this. <div><br></div><div>Would you please kindly share those names of the books so at least I have an idea about what resources are available and in case I need more explanation than this Language Reference Manual ?</div><div><br></div><div>Once again thanks.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 9, 2021 at 3:57 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</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">There are some books, but if you're looking for the best reference for LLVM IR it's online here: <a href="https://llvm.org/docs/LangRef.html" target="_blank">https://llvm.org/docs/LangRef.html</a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 9, 2021 at 3:43 PM Mihir Sevak 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">Hello LLVM group,<div> I am very new to this project. I want to develop a few things on LLVM platform and for that I am wondering where can I learn about Intermediate Representation used in LLVM project? Is there any in-depth instruction level guide available except online tutorials? </div><div><br></div><div>Please advise.</div><div><br></div><div>Thanks.</div><div>Have a great weekend. <br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>"How can anything be impossible when impossible itself says I M Possible???"®<br>Mihir Sevak<br></div></div></div></div></div></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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>"How can anything be impossible when impossible itself says I M Possible???"®<br>Mihir Sevak<br></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>"How can anything be impossible when impossible itself says I M Possible???"®<br>Mihir Sevak<br></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>"How can anything be impossible when impossible itself says I M Possible???"®<br>Mihir Sevak<br></div></div></div></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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>"How can anything be impossible when impossible itself says I M Possible???"®<br>Mihir Sevak<br></div></div></div></div></div>