<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Dalas,<div class=""><br class=""></div><div class="">If you’re interested in swift specifically, it would make sense to ask on the swift dev forum. There is a lot of thought and time that went into the design of SIL.</div><div class=""><br class=""></div><div class="">More generally though, designing an IR like this is all about deciding what level of representational abstraction you need, and this is principally driven by what sorts of optimizations you want to do, and what sort of software abstractions you want to simplify the lowering from one level to another.</div><div class=""><br class=""></div><div class="">In the case of the former, Clang has its “CFG” data structure, but otherwise lacks a great representation for doing language-specific dataflow based analysis and optimization. We should be able to do things like reference count optimizations of std::shared_ptr, should be able to do advanced temporary-elimination optimizations which only appear after inlining, should be able to do STL specific optimizations like inserting “reserve” calls before loops that fill in data structures, etc.</div><div class=""><br class=""></div><div class="">On the lowering side of things, Clang’s CodeGen is monolithic, very complicated, and includes lots of concerns mixed up. The most egregious of which is that the C/C++ ABI lowering stuff all happens in one place, and there is no good way to factor this logic across the LLVM ecosystem, other than generating C++ ASTs (or writing thunks in C++ and compiling them to IR with clang, then inlining them, etc). This makes me really sad, and is something that a nice CIL could fix or at least drastically improve.</div><div class=""><br class=""></div><div class="">-Chris<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 1, 2019, at 9:10 PM, ComputerFreak via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="caret-color: rgb(0, 0, 0); font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-size: 10pt; font-family: Gulim, sans-serif;" class=""><div style="margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px; background-color: rgb(255, 255, 255);" class="">Hi, folks. I am trying to understand the Intermediate Language in LLVM infrastructure.</div><div style="margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px; background-color: rgb(255, 255, 255);" class="">But I cannot quite catch the grasp on how the Intermediate Language comes out. </div><div style="margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px; background-color: rgb(255, 255, 255);" class="">I have some questions.</div><p style="margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px; background-color: rgb(255, 255, 255);" class=""> </p><div style="margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px; background-color: rgb(255, 255, 255);" class="">1. When developing the new Intermediate Language on Swift Programming Language, Have you started the development from the Parser, which is the beginning of the Compiler? </div><p style="margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px; background-color: rgb(255, 255, 255);" class=""> </p><div style="margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px; background-color: rgb(255, 255, 255);" class="">2. I searched some good Intermediate Language Projects, but couldn't find the good specification on IL-like projects. Would you able to give some lists of the good Intermediate Language Projects to get some brief Overview on this? </div><p style="margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px; background-color: rgb(255, 255, 255);" class=""> </p><p style="margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px; background-color: rgb(255, 255, 255);" class=""> </p><div style="margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px; background-color: rgb(255, 255, 255);" class="">Dalas</div></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">cfe-dev mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="mailto:cfe-dev@lists.llvm.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">cfe-dev@lists.llvm.org</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a></div></blockquote></div><br class=""></div></body></html>