<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>What I have in my mind now is making the general Clang
Intermediate Language(CIL).</p>
<p>When developing the Graphics card compiler based on LLVM
Infrastructure, the optimization is fairly able on LLVM IR. But
the problem is that most programmer are more familar to C-style
code, not LLVM IR code. Also the fact that LLVM IR is more
RISC-like format, there is some limitation to optimize which
should be easy if the C/C++/Objective-C Intermediate Language is
on clang. <br>
</p>
<p>Also what I have in mind is that most software patterns what most
programmers want to optimize could be accomplished with just
simplified Intermediate Language. With more C-like Intermediate
Language, Specified Type-Statement on CIL for making software
engineers able to easily optimize. <br>
</p>
<p>Though I have some concerns whether this higher-level IR which is
more than LLVM IR could help optimize because it feels like
duplicating the IR layer. Still doubt on whether this CIL is
necessary for LLVM and Clang Infrastructure... <br>
</p>
<p><br>
</p>
<p>P.S. I wish there are some SPIR-V developers, and share their
thought on the CIL. <br>
</p>
<div class="moz-cite-prefix">On 19. 3. 3. 오전 2:10, Chris Lattner
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:7183A568-6105-4CD0-80D0-8EDD7857E6DB@nondot.org">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
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="" moz-do-not-send="true">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=""
moz-do-not-send="true">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=""
moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a></div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
</body>
</html>