I begin to get acquainted with the implementation of algorithms of code-generation and optimizations in gcc and llvm. Can anyone give an advice on where to see materials, articles, lectures about how it arranged in these compilers? I was trying to find something where described in fairly simple language such things as optimization and code generation algorithm's implementation or simply detailed explanation, but I didn't find. Maybe there is a exhaustive guide where I'll be able to find information about exact classes and methods which are called, in what files are these algorithms written, basic structures with which they operate (symbol tables and their entries, graphs, AST, struct tree and rtl in gcc etc). I'm familiar with Steven Muchnick's "Advanced compiler design and implementation", but it's quite complicated to find something similar in source codes of gcc and llvm to algorithms in ICAN notation without some useful information.
Summary:
My goal is to get acquainted with the implementation of optimization algorithms and code generation on the example of gcc and llvm. So I would like to find materials that somehow simplify reading of source code of gcc or llvm. I hope that these materials exist.
Your question is off-topic here (since about finding resources and books).
However, for GCC, I did collect several references and wrote hundreds of slides, see the documentation page of GCC MELT (and many web pages pointed from it).
For LLVM, you need to find equivalent documentation (there are lot of them too).
GCC MELT is now -in November 2017- an inactive project (so my slides cover older GCC versions). I could be funded to work on something similar.
You won't find anything exhaustive and up to date because both GCC and Clang are evolving significantly and continuously. The most exhaustive is still the source code (of millions of lines, growing by a few percents each year), and the community behind it. You'll need several years of work (full-time) to comprehend these monster free software projects, and you should also follow their evolution.
Once you have spent several weeks reading about GCC and looking inside the source code, you can ask some precise questions on
[email protected]. If you experiment some GCC plugin or work on your own fork of GCC, be sure to make it free software and publish now your alpha-quality -even buggy and incomplete- source code somewhere -perhaps on github- before asking, under a GPL license.BTW, real-life compilers are much more complex than what is taught in textbooks, even as good as the Dragon Book. Nobody can understand GCC (or LLVM) completely (it is too complex for a single brain, and is evolving too fast) - and that also holds for any multi-million lines software project.
Most of what I have written on GCC MELT (notably the slides that are not MELT specific, and all the references I have collected) fits that goal. However, the autoritative material is the -continuously changing- source code of GCC.
NB: My
gcc-melt.orgdomain will be lost in April 2018 (and I probably won't renew it). So look on http://starynkevitch.net/Basile/gcc-melt which should be kept longer.