<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:10pt;color:#000000;font-family:Helvetica,Arial,sans-serif;" dir="ltr">
<p>While I certainly understand a desire to accelerate Flang/F18 development, I worry paths #1 and #2 miss the goal of supporting strong Fortran capabilities.  <br>
</p>
<p><br>
</p>
<p>To echo what Eric said in a slightly different way, the FIR stage supports Fortran-centric analysis and optimization capabilities. I believe LLVM IR (at the core or in MLIR form) looses an awareness that is needed to develop a fully optimizing Fortran compiler. 
 #1 and #2 support a path for a (perhaps more C-family friendly) optimizing compiler but not necessarily that of an optimizing Fortran compiler.  I think that's a significant difference and a disadvantage -- one that likely misses many of the potential advantages
 to be gained by analysis and optimization at a level with more Fortran awareness.
<br>
</p>
<p><br>
</p>
<p>Before adoption into the LLVM community, the plan of record for F18/Flang was to introduce a FIR level to enable such Fortran-centric features.  By leveraging MLIR there is a chance to avoid building an entirely one-off piece of infrastructure. In fact,
 it may (probably is) the case that an MLIR-base implementation may be (probably is) more robust than a brand new, stand alone, FIR implementation. 
<br>
</p>
<p><br>
</p>
<p>There may be a good argument for a faster delivery path but we should also understand that it is likely to fall short of achieving what many would consider Fortran-centric performance improvements.  I think the only way to gain some of the advantages of
 the FIR implementation path in approach #1 or #2 would require changes at the LLVM IR level.   I'm not sure that's a reasonable path to take across the board...
<br>
</p>
<p><br>
</p>
<div>—Pat</div>
<div>
<div id="AppleMailSignature">
<div class="ApplePlainTextBody" style="color:rgb(0,0,0); font-family:"Trebuchet MS"; font-size:14px; font-style: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">
<br>
</div>
</div>
<div class="AppleOriginalContents" style="direction:ltr">
<blockquote type="cite">
<div>On Dec 2, 2019, at 4:10 PM, Doerfert, Johannes via flang-dev <flang-dev@lists.llvm.org> wrote:</div>
<br class="Apple-interchange-newline">
<div><span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">On
 12/02, Eric Schweitz (PGI) wrote:</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<blockquote type="cite" class="" style="font-family:TrebuchetMS; font-size:14px; font-style: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; text-decoration:none">
On 11/25, Johannes Doefert wrote:<br class="">
<blockquote type="cite" class="">On 11/25, Mehdi AMINI wrote:<br class="">
<blockquote type="cite" class="">On Mon, Nov 25, 2019 at 4:25 PM Doerfert, Johannes via flang-dev <<br class="">
flang-dev@lists.llvm.org> wrote:<br class="">
<br class="">
<blockquote type="cite" class="">(I BCC'ed flang-dev as they might be interested in this as well.)<br class="">
<br class="">
Last week at SC we were discussing what the fastest and safest way to<br class="">
get a working (=stable) F18 compiler is. Designing FIR and two (or<br class="">
three) lowerings (AST -(1)-> FIR -(2)-> (MLIR LLVM-IR -(3)->) LLVM-IR)<br class="">
seems to be something we want to end up eventually but it might not be<br class="">
the fastest solution.<br class="">
<br class="">
The options I'm currently evaluating wrt. complexity to stable solution,<br class="">
and which I will discuss in more detail on the flang-dev list, are:<br class="">
 1) AST -> LLVM-IR<br class="">
 2) AST -> MLIR LLVM-IR -> LLVM-IR<br class="">
 3) AST -> FIR -> MLIR LLVM-IR -> LLVM-IR<br class="">
<br class="">
</blockquote>
<br class="">
I suspect 2 makes sense over 1 only if you include more MLIR construct<br class="">
(like the OpenMP dialect), otherwise I don't see the difference between 1<br class="">
and 2?<br class="">
</blockquote>
<br class="">
It depends. I think 1 is "less" work but more "wasted" work.<br class="">
</blockquote>
<br class="">
1. Trying to bridge from the f18 parse trees straight to LLVM-IR will be a ton<br class="">
of work and should be throw-away work at that.<br class="">
</blockquote>
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">I'd
 like to understand what work would be conceptually different to</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">things
 we need to do for 3) as well. I would have assumed we need to</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">lower
 Fortran constructs to LLVM-IR eventually, if we do it in one or</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">two
 steps should not matter much except that in the former case we do</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">not
 need to keep some Fortran constructs alive in a different</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">representation.</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">I
 would also think the second lowering step in 3) (FIR -> LLVM-IR)</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">would
 look pretty much like the lowering in 1)? If you disagree please</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">let
 me know why.</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<blockquote type="cite" class="" style="font-family:TrebuchetMS; font-size:14px; font-style: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; text-decoration:none">
2. has problems in that semantics from Fortran cannot be represented in generic<br class="">
off-the-shelf MLIR. It would've been great, but alas. :)<br class="">
</blockquote>
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Interesting.
 Does that mean you do not plan to lower FIR to the LLVM-IR</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">MLIR
 dialect at all or do you plan to make MLIR stronger to support the</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">lowering?</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<blockquote type="cite" class="" style="font-family:TrebuchetMS; font-size:14px; font-style: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; text-decoration:none">
3. This is where the real action is presently. It would be great to have more<br class="">
volunteers, who want to contribute to the project, jump in and assist here.<br class="">
There is plenty that can be worked on. Please contact me, if interested.<br class="">
</blockquote>
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">As
 I mentioned on the MLIR mailing list before, I'm not looking for more</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">work
 (others might though). On the contrary, I'm trying to determine how</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">we
 can get a working Fortran compiler with the least amount of work. The</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">MLIR
 folks have also mentioned various (fairly basic) parts that need to</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">be
 worked on (see the thread on the other list).</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<blockquote type="cite" class="" style="font-family:TrebuchetMS; font-size:14px; font-style: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; text-decoration:none">
<blockquote type="cite" class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">My questions/statements here are concerning the MLIR LLVM-IR dialect and<br class="">
the lowerings to/from it, as well as the interplay of MLIR dialects and<br class="">
LLVM-IR. I formulated some parts as statements and I would appreciate it<br class="">
if you could comment on my understanding. If I missed the appropriate<br class="">
documentation page, please forgive me.<br class="">
<br class="">
1) Can I lower different dialects into LLVM-IR at the same time or do I<br class="">
  need to lower to MLIR LLVM-IR first? When I ask if "I can do that" I<br class="">
  mean if it is a use case that should conceptually work and also if it<br class="">
  is already done by someone, thus actually working right now.<br class="">
<br class="">
</blockquote>
<br class="">
You can export to LLVM IR on your own from any dialect (ultimately Clang<br class="">
does it while traversing its AST, so you can traverse your own IR the same<br class="">
way).<br class="">
</blockquote>
<br class="">
Perfect. That is needed for the FIR + OpenMP dialect already since the<br class="">
latter shall not be lowered to MLIR LLVM-IR first.<br class="">
</blockquote>
<br class="">
The Tilikum bridge lowers the bulk of FIR (modulo bugs and NYI features) and<br class="">
the standard MLIR dialect both in one big dialect conversion. Much of Tilikum<br class="">
is prototyped now.<br class="">
</blockquote>
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Tilikum
 bridge? Is that what lowers FIR + MLIR into LLVM-IR? Where do I</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">find
 this prototype? Is there a list of features (expceted to be) working?</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<blockquote type="cite" class="" style="font-family:TrebuchetMS; font-size:14px; font-style: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; text-decoration:none">
But that's the beginning of the story, as there are features to be completed<br class="">
in the MLIR LLVM-IR dialect as well (which is where your subsequent conversion<br class="">
goes).  Furthermore, features to support Fortran will need to find their way<br class="">
into LLVM (proper) itself.<br class="">
</blockquote>
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Could
 you elaborate on both these points? What features do we need in</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">the
 LLVM-IR MLIR dialect? (Do we lower FIR into that one? see above.)</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">What
 features are you missing in LLVM-IR? It might be good to get these</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">discussions
 going earlier than later to speed up the development and</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">planning
 process.</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<blockquote type="cite" class="" style="font-family:TrebuchetMS; font-size:14px; font-style: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; text-decoration:none">
<blockquote type="cite" class="">
<blockquote type="cite" class="">The point of the LLVM dialect is to make this easier and more re-usable /<br class="">
composable though.<br class="">
</blockquote>
<br class="">
That makes sense.<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">2) I browsed the LLVM-IR MLIR dialect and it looks like the<br class="">
  instructions, attributes, etc. are hard coded, correct? (I mean we<br class="">
  need to add them one by one to match LLVM-IR and keep them in-sync).<br class="">
<br class="">
</blockquote>
<br class="">
Yes.<br class="">
<br class="">
We have this longer term idea to generate the LLVM IR constructs (at least<br class="">
the verifiers, etc.) from the same tablegen as the MLIR dialect (it can be<br class="">
generating the MLIR dialect from a TableGen in LLVM for instance), that's<br class="">
gonna take more discussions within LLVM though.<br class="">
</blockquote>
<br class="">
I think that is reasonable, probably takes a while to prepare though.<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">3) As far as I can tell,<br class="">
  a) various instructions are present already (in their basic form,<br class="">
     e.g., no nsw/nuw, inbounds, ...) but there seems to be some<br class="">
     missing (switch was one I didn't find immediatly). Is there a<br class="">
     list?<br class="">
<br class="">
</blockquote>
<br class="">
I don't think we have a list, we discussed this recently:<br class="">
https://groups.google.com/a/tensorflow.org/d/msg/mlir/gUTcuFex7eA/Ebj38saiBQAJ<br class="">
It'd be nice to compute the full list indeed.<br class="">
</blockquote>
<br class="">
Thanks for the reference. I read this thread a month ago but forgot<br class="">
about it again.<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">  c) I also did only find a handful of attributes (noalias &<br class="">
nosideeffect).<br class="">
<br class="">
</blockquote>
<br class="">
I don't even think that "nosideeffect" maps to anything when exporting to<br class="">
LLVM IR at the moment.<br class="">
</blockquote>
<br class="">
Right. So noalias is the blueprint it seems.<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">  d) Global symbols seems to be very restricted right now e.g.,<br class="">
     variables are internal only, functions external, right?<br class="">
<br class="">
</blockquote>
<br class="">
Right, we haven't yet added Linkage and ThreadLocalMode attributes on<br class="">
these. The dialect has been brought as the need came for lowering from<br class="">
higher-level dialects.<br class="">
The more interesting part is handling these in the general FuncOp.<br class="">
</blockquote>
<br class="">
What do you mean with the last sentence? Is there some bigger design<br class="">
question here to add linkage types (etc.) to the MLIR LLVM-IR dialect?<br class="">
<br class="">
Cheers,<br class="">
 Johannes<br class="">
</blockquote>
<br class="">
--<br class="">
Eric<br class="">
<br class="">
<br class="">
-----------------------------------------------------------------------------------<br class="">
This email message is for the sole use of the intended recipient(s) and may contain<br class="">
confidential information.  Any unauthorized review, use, disclosure or distribution<br class="">
is prohibited.  If you are not the intended recipient, please contact the sender by<br class="">
reply email and destroy all copies of the original message.<br class="">
-----------------------------------------------------------------------------------<br class="">
</blockquote>
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Cheers,</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important"> Johannes</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">--<span class="Apple-converted-space"> </span></span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Johannes
 Doerfert</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Researcher</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Argonne
 National Laboratory</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Lemont,
 IL 60439, USA</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="mailto:jdoerfert@anl.gov" class="" style="font-family:TrebuchetMS; font-size:14px; font-style: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">jdoerfert@anl.gov</a><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">flang-dev
 mailing list</span><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="mailto:flang-dev@lists.llvm.org" class="" style="font-family:TrebuchetMS; font-size:14px; font-style: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">flang-dev@lists.llvm.org</a><br class="" style="font-family:TrebuchetMS; font-size:14px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-dev" class="" style="font-family:TrebuchetMS; font-size:14px; font-style: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">https://lists.llvm.org/cgi-bin/mailman/listinfo/flang-dev</a></div>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>