<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        mso-add-space:auto;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
        {mso-style-priority:34;
        mso-style-type:export-only;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        mso-add-space:auto;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
        {mso-style-priority:34;
        mso-style-type:export-only;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        mso-add-space:auto;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
        {mso-style-priority:34;
        mso-style-type:export-only;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        mso-add-space:auto;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:2042657427;
        mso-list-type:hybrid;
        mso-list-template-ids:1765343044 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi fellow Flang developers!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Below are the notes taken during the Flang Roundtable at the LLVM Dev Meeting today.  Please feel free to comment with corrections and/or questions.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
<p class="MsoNormal">-- Alexis<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-------------------------------------------------<o:p></o:p></p>
<p class="MsoNormal"><span style="color:black">Alexis Perry-Holby</span><span style="font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#C1C1C1">Los Alamos National Laboratory</span><span style="font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#C1C1C1">Applied Computer Science (CCS-7)</span><span style="font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" align="center" style="text-align:center">Flang Roundtable – 11/18/2021<o:p></o:p></p>
<p class="MsoListParagraphCxSpFirst"><u>TOPIC: Upstreaming<o:p></o:p></u></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Upstreaming status update<o:p></o:p>
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Working on Optimizer now – FIR dialect and passes that convert it to LLVM IR dialect<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
CodeGen right now, likely finished next week<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Lowering next – goes from Flang parse tree to FIR/MLIR operations<o:p></o:p>
<ul style="margin-top:0in" type="square">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level3 lfo1">
Will need to be an initial big chunk to allow for testability<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level3 lfo1">
Then smaller chunks can be upstreamed in parallel<o:p></o:p></li></ul>
</li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
~38 statements to go<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Intrinsics can be upstreamed separately (~58 of them)<o:p></o:p></li></ul>
</li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
First Lowering patch, including expression handling – will it include tests?  (Yes)<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
How big will it be? (not sure)<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Possibility of using unit tests instead of FileCheck tests for the big patch?<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Document in expression handling patch - why it needs to be the size chunk that it is<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Boards<o:p></o:p>
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
<span style="color:black">CodeGen: </span><a href="https://github.com/flang-compiler/f18-llvm-project/projects/4"><span style="color:#1155CC">https://github.com/flang-compiler/f18-llvm-project/projects/4</span></a> <o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
<span style="color:black">Statement Lowering: </span><a href="https://github.com/flang-compiler/f18-llvm-project/projects/6"><span style="color:#1155CC">https://github.com/flang-compiler/f18-llvm-project/projects/6</span></a> <o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
<span style="color:black">Intrinsic Lowering: </span><a href="https://github.com/flang-compiler/f18-llvm-project/projects/5"><span style="color:#1155CC">https://github.com/flang-compiler/f18-llvm-project/projects/5</span></a><o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
These are good places for people to look for ways to contribute to the effort<o:p></o:p></li></ul>
</li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Are boards enabled in llvm-project?<o:p></o:p>
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Not now, perhaps moving to GitHub issues will make for something<o:p></o:p></li></ul>
</li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Writing unit tests<o:p></o:p>
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
It would be good to incorporate more of these<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Need people to work on it (Andrzej will explore, but we will need others)<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Might be hard to do for more complex expression handling, but would be good for simple expressions<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Unit tests may have to drive the parser to be able to do things (possibly more pieces too)<o:p></o:p></li></ul>
</li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Would the big expression handling patch enable tests that go from Fortran -> FIR/LLVM?<o:p></o:p>
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Likely for simple things (ex. Check that 2+2=4)<o:p></o:p></li></ul>
</li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Expression handling will enable the addition of things like OpenMP lowering, etc. to readily follow<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Is there anything left to upstream after Lowering?<o:p></o:p>
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
There are some more things like runtime and semantics<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
But it’s kind of the last big chunk<o:p></o:p></li><li class="MsoListParagraphCxSpLast" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Could be done in parallel with what we’re currently doing (they are independent of Lowering)<o:p></o:p></li></ul>
</li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><u>OTHER TOPICS<o:p></o:p></u></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraphCxSpFirst" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Driver can make an executable now!<o:p></o:p>
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Patch has been approved (on fir-dev?), and is awaiting merge<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Is now a good time to switch name from flang-new to flang?<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Rename the bash script in upstream now?<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Rich: What about a switch in the build configuration that installs the bash script as flang and leaves flang-new if enabled and otherwise installs the new driver as flang<o:p></o:p></li></ul>
</li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Need to make sure that bbc+tco stays in sync with the driver (flang-new)<o:p></o:p>
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
So that we can test with any/all of them, but so that they don’t diverge in how they do things<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Buildbots for both?  So developers can use bbc+tco or flang-new, but users can stick to flang-new<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Why not remove bbc+tco?<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Reconfigure tests so they can switch back and forth?  Will need to make sure the same flags can be used<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Parser tests use flang-new, tests for Lowering use bbc+tco<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Do we refactor all tests that use bbc now so that they can use flang-new?<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Problem comes because there is functionality overlap between flang-new and bbc+tco  (unlike clang, opt, and llc)<o:p></o:p></li></ul>
</li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Fortran 2003 design work, once F95 is complete?<o:p></o:p>
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Documentation not quite written yet, will be shared with community when ready<o:p></o:p></li></ul>
</li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level1 lfo1">
Two different ways to approach continued development: keep chasing standards or make a high-quality F95 compiler with optimizations and such?<o:p></o:p>
<ul style="margin-top:0in" type="circle">
<li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Performance optimization work welcome<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Slow-downs with SNAP at the moment<o:p></o:p></li><li class="MsoListParagraphCxSpMiddle" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Reduce the number of memory copies being done<o:p></o:p></li><li class="MsoListParagraphCxSpLast" style="margin-left:0in;mso-add-space:auto;mso-list:l0 level2 lfo1">
Alias analysis is important, how much will MLIR handle that?<o:p></o:p></li></ul>
</li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>