<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">On 3/1/19 7:12 AM, Petr Penzin via llvm-dev wrote:<br>
</div>
<blockquote type="cite" cite="mid:0a5f86d9-f581-c306-3c0c-3715d0e084bc@gmail.com">
<p>Following up on my earlier email. If there is a commitment to checking in f18 already, feel free to disregard it. I went and took a little bit closer look at the sources and want to share some of the findings in case if anyone is interested. Disclosure:
 I contribute to <a moz-do-not-send="true" href="http://fort-compiler.org/">Fort</a> (fort-compiler.org), which is the fork of the front-end David Greene mentioned.<br>
</p>
<p>From Stephen's announcement:<br>
</p>
<blockquote type="cite">
<p class="MsoNormal" style="caret-color: rgb(0, 0,

          0);font-variant-caps: normal;orphans:

          auto;text-align:start;widows:
          auto;-webkit-text-size-adjust:

          auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span style="color:black">At this point, we have documented and implemented a healthy subset of the compiler for symbol tables and scoping, name resolution, USE statements and module files, constant representation, constant folding and much of declaration,
 label and expression semantics. The parser handles all of Fortran 2018 and OpenMP 4.5 and implements a Fortran-aware preprocessor. The Fortran control flow graph (CFG) is in review now.  We continue to update other documentation, such as the style guide and
 runtime descriptor design.</span></p>
<span style="color:black"></span></blockquote>
Currently it looks like only the parser is <i>partially</i> implemented in f18, there is no code generator (via LLVM or otherwise) and, obviously, no object output. For that reason and due to the condition of its test suite it is impossible to reliably assess
 the state of Fortran 18 support (thought it does look like a fair amount of effort went into it). State of OpenMP support actually got me a bit puzzled, more on that below.<br>
<p>As I understand the announcement, f18 is intended to be used or merged with Flang sources at some point, but that still does not explain how it would integrate with LLVM, since Flang does not seem invoke LLVM directly either (it used to produce LLVM IR as
 text files). Because of this, it is likely that its code generator component would have to be written from scratch. It is also unclear if and how it would provide the library API which has been announced.<br>
</p>
<p>A bit about the test suite -- I looked at the Fortran (regression) part of it (as opposed to unit tests, which hopefully are a relatively simple affair). Maybe nitpicking, but despite "handles all of OpenMP 4.5" statement in the announcement there seem to
 be only two references to OpenMP in tests. Most of the regression tests are challenging to understand -- some list all expected output upfront, some of the expected output is not particularly human-friendly. Maybe I am used to Clang's test suite, but it is
 unclear to me what each file is testing. Also, regression testing relies on a set of shell scripts to do some of the output checking.<br>
</p>
<p>My worry here that it would actually take years to develop f18 into an a working compiler,</p>
</blockquote>
<p><br>
</p>
<p>I believe that your assessment below says more about the state of the regression tests in f18 than the capabilities of the code. f18 can currently parse, and unparse, a lot of Fortran code (+OpenMP). From talking to Steve and company, this part of the current
 codebase is well tested. Based on the current rate of development and experience of the team, and I don't expect it to take many years to develop f18 into a working compiler.</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:0a5f86d9-f581-c306-3c0c-3715d0e084bc@gmail.com">
<p>in which case there might be other options worth considering for a Fortran front-end.</p>
</blockquote>
<p><br>
</p>
<p>As a community, we should always consider all reasonable options. You should certainly feel free to make specific suggestions.<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:0a5f86d9-f581-c306-3c0c-3715d0e084bc@gmail.com">
<p>In my opinion (and this <i>may</i> be a matter of personal preference) a healthier subset of the compiler would be more of an end-to-end subset of it -- something that can be tested as a full product while it is being developed.</p>
</blockquote>
<p><br>
</p>
<p>We always aim to commit functionality in independently-testable units. If the parser is implemented first, and that is accompanied by parser tests, that's a perfectly-reasonable approach. One reason why I've encouraged NVIDIA to start this RFC process as
 soon as possible is because we want to have community feedback on the design and the implementation (including the tests), and moreover, broaden the set of contributors. Maximizing that feedback and the pool of contributors essentially requires that the development
 happen within the community - it needs to be a community project.<br>
</p>
<p>That community, of course, includes all of us. If you would like to contribute to the design and/or implementation of a Fortran frontend within the LLVM project, you certainly should. As you've been working on a Fortran frontend project, I definitely encourage
 you to do so. All code contributed to LLVM is subject to code review by the community, both before and after it is committed.<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:0a5f86d9-f581-c306-3c0c-3715d0e084bc@gmail.com">
<p>And then there is also the argument for reusing Clang tooling, which David Greene keeps making, though that idea does not seem to get a lot of interest.<br>
</p>
</blockquote>
<p><br>
</p>
<p>I disagree. There's been a lot of interest in modeling Flang's tooling after Clang's infrastructure, and refactoring for direct reuse where possible. In general, refactoring for code reuse is our default - developing similar functionality without reusing
 existing, related code is what, in general, requires specific justification.<br>
</p>
<p> -Hal<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:0a5f86d9-f581-c306-3c0c-3715d0e084bc@gmail.com">
<p></p>
<p><br>
</p>
<p>Best,</p>
<p>Petr<br>
</p>
<div class="moz-cite-prefix">On 2/27/19 1:55 PM, Chris Lattner via llvm-dev wrote:<br>
</div>
<blockquote type="cite" cite="mid:27EDA52D-3E05-47A0-80FC-F2C635B0299F@nondot.org">
On Feb 25, 2019, at 10:06 AM, Stephen Scalpone via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="" moz-do-not-send="true">llvm-dev@lists.llvm.org</a>> wrote:<br class="">
<div>
<blockquote type="cite" class=""><span style="font-family:
 Calibri, sans-serif; font-size:
              12pt;" class="">We're committed to developing LLVM's Fortran frontend for years to come, and together with other members of the LLVM community (e.g.,
 ARM, US Dept of Energy) would like to do so as part of the LLVM project.</span><br class="">
</blockquote>
<div><br class="">
</div>
<div>This is super exciting Stephen, congratulations to you and everyone working on f18.  I’m very excited to see this happening and am thrilled about the approach you are taking.</div>
<div><br class="">
</div>
<blockquote type="cite" class="">
<div class="WordSection1" style="page: WordSection1;

              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;">
<div style="margin: 0in 0in 0.0001pt; font-size:
                12pt;
 font-family: Calibri, sans-serif;
                caret-color: rgb(0, 0,
 0); font-variant-caps:
                normal; text-align: start;

                -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<span style="" class="">The f18 compiler source code complies with most of LLVM's coding guidelines; however, the code uses several C++17 features.  We've documented our use of C++17 here:<o:p class=""></o:p></span></div>
<div style="margin: 0in 0in 0.0001pt; font-size:
                12pt;
 font-family: Calibri, sans-serif;
                caret-color: rgb(0, 0,
 0); font-variant-caps:
                normal; text-align: start;

                -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<span style="" class=""> <o:p class=""></o:p></span></div>
<div style="margin: 0in 0in 0.0001pt; font-size:
                12pt;
 font-family: Calibri, sans-serif;
                caret-color: rgb(0, 0,
 0); font-variant-caps:
                normal; text-align: start;

                -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<span style="" class=""> <span class="apple-converted-space"> </span><a href="https://github.com/flang-compiler/f18/blob/master/documentation/C++17.md" style="color: rgb(149, 79, 114);
                    text-decoration:
 underline;" class="" moz-do-not-send="true"><span style="color: rgb(149,
                      79, 114);" class="">https://github.com/flang-compiler/f18/blob/master/documentation/C++17.md</span></a><o:p class=""></o:p></span></div>
<div style="margin: 0in 0in 0.0001pt; font-size:
                12pt;
 font-family: Calibri, sans-serif;
                caret-color: rgb(0, 0,
 0); font-variant-caps:
                normal; text-align: start;

                -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<br class="">
</div>
<div style="margin: 0in 0in 0.0001pt; font-size:
                12pt;
 font-family: Calibri, sans-serif;
                caret-color: rgb(0, 0,
 0); font-variant-caps:
                normal; text-align: start;

                -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<span style="" class="">Our request would be to get a waiver for the C++11 requirement based on the fact that we're skating to where the puck will be.  In the meantime, because F18 only exists as a stand-alone program, early adopters would still have a useful
 parser and analyzer for Fortran.<o:p class=""></o:p></span></div>
</div>
</blockquote>
<br class="">
</div>
<div>I personally see no problem or concerns with this at all.  This is a new project and the worst case is that f18 comes up with some really cool stuff that the rest of the LLVM project would love to share, but that can’t be done until it is refactored to
 not use c++11.  If/when that comes up, we can deal with it on demand.  I don’t see any particular reason to block f18 from joining the project because of that speculative concern.</div>
<div><br class="">
</div>
<div>-Chris</div>
<div><br class="">
</div>
<br class="">
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org" moz-do-not-send="true">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>