<html xmlns:v="urn:schemas-microsoft-com:vml" 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:"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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:windowtext">We are in the beginning in F18/flang as you mentioned. I agree that it would be great if we have a common code generator for the frontends. However, I am not seeing any intersecting between the internals of
 clang and flang that we can rely on to implement "OpenMP-IRBuilder".<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">This would be great if the RFC is elaborated.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Best <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">-Guray<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span style="color:windowtext"> Alexey Bataev <a.bataev@outlook.com>
<br>
<b>Sent:</b> Friday, May 3, 2019 5:13 PM<br>
<b>To:</b> Guray Ozen <gozen@nvidia.com>; Doerfert, Johannes <jdoerfert@anl.gov><br>
<b>Cc:</b> Xinmin <xinmin.tian@intel.com>; Ravi <ravi.narayanaswamy@intel.com><br>
<b>Subject:</b> Re: [RFC] Proposed interplay of Clang & Flang & LLVM wrt. OpenMP [@Flang-dev]<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>1. That's why it was recommended to implement it as a kind of plugin for Clang. It is a bad idea to expose clang/fortran internals to LLVM and it won't be accepted.<o:p></o:p></p>
<p>2. In priniciple, the idea can be implemented. But instead of the classes, you may pass functions to the codegen plugin, which know how to work with the classes in Clang/Flang.<o:p></o:p></p>
<pre>-------------<o:p></o:p></pre>
<pre>Best regards,<o:p></o:p></pre>
<pre>Alexey Bataev<o:p></o:p></pre>
<div>
<p class="MsoNormal">03.05.2019 11:04, Guray Ozen пишет:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Hi Johannes,<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>That sounds interesting. However, I have a few questions about your RFC.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>From what I understand, you are suggesting a general "OpenMP-IRBuilder" where different frontends will benefit, and it will be in core-LLVM. However, the front ends may have very different AST. How do you plan to provide a common interface for different ASTs? If it will be aware of front-end ASTs, how would be a general IR builder? Also, if it is specific to AST, do you think it should be somewhere other than the core LLVM? <o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>You also outlining in the end, so will clang still do the early outlining?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Best<o:p></o:p></pre>
<pre>- Guray <o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: flang-dev <a href="mailto:flang-dev-bounces@lists.flang-compiler.org"><flang-dev-bounces@lists.flang-compiler.org></a> On Behalf Of Doerfert, Johannes via flang-dev<o:p></o:p></pre>
<pre>Sent: Friday, May 3, 2019 4:35 PM<o:p></o:p></pre>
<pre>To: Alexey Bataev <a href="mailto:a.bataev@outlook.com"><a.bataev@outlook.com></a><o:p></o:p></pre>
<pre>Cc: <a href="mailto:flang-dev@lists.flang-compiler.org">flang-dev@lists.flang-compiler.org</a>; Xinmin <a href="mailto:xinmin.tian@intel.com"><xinmin.tian@intel.com></a>; Ravi <a href="mailto:ravi.narayanaswamy@intel.com"><ravi.narayanaswamy@intel.com></a><o:p></o:p></pre>
<pre>Subject: Re: [Flang-dev] [RFC] Proposed interplay of Clang & Flang & LLVM wrt. OpenMP [@Flang-dev]<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>[Respond on the flang-list to a comment on the others.]<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>________________________________<o:p></o:p></pre>
<pre>From: Alexey Bataev <a href="mailto:a.bataev@outlook.com"><a.bataev@outlook.com></a><o:p></o:p></pre>
<pre>Sent: Thursday, May 2, 2019 11:54:14 AM<o:p></o:p></pre>
<pre>To: Doerfert, Johannes; LLVM-Dev<o:p></o:p></pre>
<pre>Cc: <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>; Openmp-dev<o:p></o:p></pre>
<pre>Subject: Re: [Openmp-dev] [RFC] Proposed interplay of Clang & Flang & <o:p></o:p></pre>
<pre>LLVM wrt. OpenMP [@Flang-dev]<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>What you're talking about is the late outlining, which should be the <o:p></o:p></pre>
<pre>part of the LLVM. As I understand, Intel already has preliminary <o:p></o:p></pre>
<pre>implementation of this and they promised to publish it in May.<o:p></o:p></pre>
</blockquote>
<pre><o:p> </o:p></pre>
<pre>This is completely unrelated to late outlining, which may or may not become part of LLVM:<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>- Late outlining is about _how_ parallelism/OpenMP is lowered in the<o:p></o:p></pre>
<pre>  front-end and potentially again later on.<o:p></o:p></pre>
<pre>- This proposal is about _where_ the encoding happens and how we keep<o:p></o:p></pre>
<pre>  Clang & Flang in-sync.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>If we decide to adopt a late outlining scheme, there would be a single location where we implement it in the "front-end", the OpenMP-IRBuilder.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Also, this was discussed some time ago, if I remember it correctly, <o:p></o:p></pre>
<pre>and it was recommended to implement this common codegen as a kind of <o:p></o:p></pre>
<pre>plugin. I don't remember the final result of this discussion, though.<o:p></o:p></pre>
</blockquote>
<pre><o:p> </o:p></pre>
<pre>I don't understand this comment. What do you mean by "kind of plugin"?<o:p></o:p></pre>
<pre>Is there a record of the discussion so we could look up the final result?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Cheers,<o:p></o:p></pre>
<pre>  Johannes<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
</blockquote>
</div>

<DIV>
<HR>
</DIV>
<DIV>This email message is for the sole use of the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure 
or distribution is prohibited.  If you are not the intended recipient, 
please contact the sender by reply email and destroy all copies of the original 
message. </DIV>
<DIV>
<HR>
</DIV>
</body>
</html>