<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=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
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;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@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 lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">It is in the pipeline to be made public, just have not had time to finish it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Micah<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Justin Holewinski [mailto:justin.holewinski@gmail.com]
<br>
<b>Sent:</b> Monday, June 04, 2012 10:24 AM<br>
<b>To:</b> Villmow, Micah<br>
<b>Cc:</b> Stellard, Thomas; Tom Stellard; llvmdev@cs.uiuc.edu<br>
<b>Subject:</b> Re: [LLVMdev] RFC: R600, a new backend for AMD GPUs<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Is there a version of the AMDIL back-end that is compatible with LLVM 3.0/3.1?<o:p></o:p></p>
<div>
<p class="MsoNormal">On Tue, May 29, 2012 at 8:33 AM, Villmow, Micah <<a href="mailto:Micah.Villmow@amd.com" target="_blank">Micah.Villmow@amd.com</a>> wrote:<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
> -----Original Message-----<br>
> From: Stellard, Thomas<br>
> Sent: Monday, May 28, 2012 9:07 AM<br>
> To: Justin Holewinski<br>
> Cc: Villmow, Micah; Tom Stellard; <a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a><br>
> Subject: Re: [LLVMdev] RFC: R600, a new backend for AMD GPUs<br>
><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">> On Mon, May 28, 2012 at 08:54:41AM -0700, Justin Holewinski wrote:<br>
> > On May 28, 2012 6:44 AM, "Tom Stellard" <<a href="mailto:thomas.stellard@amd.com">thomas.stellard@amd.com</a>><br>
> wrote:<br>
> > ><br>
> > > On Fri, May 25, 2012 at 02:37:26PM -0700, Justin Holewinski wrote:<br>
> > > > Hi Tom,<br>
> > > ><br>
> > > > I have a higher-level question regarding this back-end.  If I have<br>
> > > > an<br>
> > LLVM<br>
> > > > IR module and run it through this back-end, it seems like the only<br>
> > output<br>
> > > > option is a binary format.  Is this a device binary, or another<br>
> > > > intermediate format?<br>
> > > ><br>
> > > > If the input LLVM IR module was a compute kernel, how would I go<br>
> > > > about executing it on an AMD GPU?  Can I use the APP SDK to load<br>
> > > > the binary, perhaps through the CAL interfaces?  How about the<br>
> > > > OpenCL binary<br>
> > interface?<br>
> > > ><br>
> > ><br>
> > > Hi Justin,<br>
> > ><br>
> > > The binary produced by this backend is meant to be consumed by AMD's<br>
> > > Open Source 3D/Compute drivers which are part of the Mesa3D[1]<br>
> > > project.  The backend is integrated into the driver, so you don't<br>
> > > need to compile shaders offline.  Currently we are using the backend<br>
> > > for graphics and compute shaders in our r600g driver (HD2xxx-HD6xxx<br>
> > > GPUs) and for graphics in our radeonsi (HD7xxx GPUs).  In the future<br>
> > > we will use it for compute shaders on radensi too.<br>
> > ><br>
> > > In order to use the backend for graphics on r600g, you need to build<br>
> > > Mesa with the --enable-r600-llvm-compiler option.  For compute the<br>
> > > installation instructions are here:<br>
> > > <a href="http://dri.freedesktop.org/wiki/GalliumCompute" target="_blank">http://dri.freedesktop.org/wiki/GalliumCompute</a><br>
> > ><br>
> > > We're working hard to get everything upstream into LLVM to so we can<br>
> > > have compute shaders working out of the box, so our users don't need<br>
> > > to manually apply patches.<br>
> ><br>
> > Okay, so there is no way to use the backend to produce loadable<br>
> > compute kernels for the proprietary drivers, or on Mac/windows?<br>
> ><br>
><br>
> Right, this is not currently possible.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">[Villmow, Micah] This is not possible with the R600 code generator, yes, but it<br>
is possible with some ELF fiddling with the AMDIL code generator which the R600<br>
is based on.<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">><br>
> -Tom<br>
><br>
> > ><br>
> > > Let me know if you have any other questions.<br>
> > ><br>
> > > -Tom<br>
> > ><br>
> > > [1] <a href="http://www.mesa3d.org/" target="_blank">http://www.mesa3d.org/</a><br>
> > ><br>
> > > > On Tue, Apr 24, 2012 at 2:52 PM, Tom Stellard <<a href="mailto:tstellar@gmail.com">tstellar@gmail.com</a>><br>
> > wrote:<br>
> > > ><br>
> > > > > On Mon, Mar 26, 2012 at 12:50:07PM -0400, Tom Stellard wrote:<br>
> > > > > > Hi,<br>
> > > > > ><br>
> > > > > > We've been working on an LLVM backend for the previous<br>
> > > > > > generation<br>
> > of AMD<br>
> > > > > > GPUs (HD 2XXX - HD 6XXX) and we would like submit it for<br>
> > > > > > inclusion<br>
> > in the<br>
> > > > > > main LLVM tree.  The latest code can be found in this git<br>
> > repository:<br>
> > > > > > <a href="http://cgit.freedesktop.org/~tstellar/llvm/" target="_blank">
http://cgit.freedesktop.org/~tstellar/llvm/</a> in the<br>
> > r600-initial-review<br>
> > > > > > branch or if you prefer you can download the entire tree with<br>
> > > > > > this<br>
> > link:<br>
> > > > > ><br>
> > > > ><br>
> > <a href="http://cgit.freedesktop.org/~tstellar/llvm/snapshot/llvm-r600-initial-" target="_blank">
http://cgit.freedesktop.org/~tstellar/llvm/snapshot/llvm-r600-initial-</a><br>
> > review.tar.gz<br>
> > > > > > The R600 backend is located in lib/Target/AMDIL<br>
> > > > > ><br>
> > > > > > First, a brief description of the backend:<br>
> > > > > ><br>
> > > > > > The r600 backend is being developed as a part of the Open<br>
> > > > > > Source<br>
> > compute<br>
> > > > > > stack in Mesa (<a href="http://www.mesa3d.org/" target="_blank">http://www.mesa3d.org/</a>), which uses the Gallium<br>
> API.<br>
> > > > > > It uses large portions of the AMDIL backend which was<br>
> > > > > > open-sourced last December and you'll notice the TargetMachine<br>
> > > > > > for this backend<br>
> > > > > > (AMDGPUTargetMachine) is a sub-class of AMDILTargetMachine.<br>
> > > > > > We are<br>
> > also<br>
> > > > > > currently working on an LLVM backend for Southern Islands<br>
> > > > > > GPUs, and<br>
> > we<br>
> > > > > > would like to get that code into the LLVM tree as well, once<br>
> > > > > > it has<br>
> > been<br>
> > > > > > approved for release.  The Southern Islands backend will be<br>
> > > > > > used for compute shaders and also graphics shaders in the AMD<br>
> > > > > > open source 3D<br>
> > > > > driver.<br>
> > > > > ><br>
> > > > > > One thing that I would like to point out is that all of the<br>
> > > > > > code from the AMDIL backend is licensed under a BSD license<br>
> > > > > > with an additional clause that deals with United States export<br>
> > > > > > laws<br>
> > (non-AMDIL<br>
> > > > > > code is licensed with the University of Illinois Open Source<br>
> > License).<br>
> > > > > > Will the LLVM project accept a backend with code licensed<br>
> > > > > > under<br>
> > this BSD<br>
> > > > > > license?  We would prefer to keep this license, but if it<br>
> > > > > > isn't acceptable, we can try to relicense it.<br>
> > > > > ><br>
> > > > > > Second, I am looking for two categories of feedback for the<br>
> > > > > > r600<br>
> > backend:<br>
> > > > > ><br>
> > > > > > 1. What changes do I need to make to get the backend included<br>
> > > > > > in the<br>
> > > > > LLVM tree.<br>
> > > > > > 2. What changes can I make to improve the backend overall.<br>
> > > > > ><br>
> > > > > > My top priority is to get the backend into the LLVM tree, so<br>
> > > > > > when you provide feedback if you could be clear about what<br>
> > > > > > changes are needed to get the backend into the tree versus<br>
> > > > > > what<br>
> > changes<br>
> > > > > > are just general improvements, I would appreciate it.<br>
> > > > > ><br>
> > > > > > Lastly, I did a very brief run through of the code to check<br>
> > > > > > the<br>
> > coding<br>
> > > > > style,<br>
> > > > > > but I know there are still some violations.  For example, a<br>
> > > > > > lot of<br>
> > the<br>
> > > > > > file headers are missing file descriptions.  I didn't want to<br>
> > > > > > spend<br>
> > a<br>
> > > > > > lot of time on coding style changes prior to the initial<br>
> > > > > > review in<br>
> > case<br>
> > > > > > I was asked to make big changes to the code, so I will address<br>
> > > > > > these issues once I have received an OK on the organization of<br>
> the code.<br>
> > > > > > However, please still point out coding style errors to me, and<br>
> > > > > > I'll<br>
> > be<br>
> > > > > > sure to fix them during the final pass.<br>
> > > > > ><br>
> > > > > > Looking forward to your feedback.<br>
> > > > > ><br>
> > > > ><br>
> > > > > Hi,<br>
> > > > ><br>
> > > > > Based on some feedback I received on IRC today, it sounds like<br>
> > > > > this is just too much code to review at once.  I'm going to try<br>
> > > > > to strip the R600 backend down to the bare minimum that is<br>
> > > > > needed for our Mesa drivers and then repost the code to the<br>
> > > > > list.  Hopefully, this will<br>
> > make it<br>
> > > > > easier for people to review.<br>
> > > > ><br>
> > > > > -Tom<br>
> > > > > _______________________________________________<br>
> > > > > LLVM Developers mailing list<br>
> > > > > <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">
http://llvm.cs.uiuc.edu</a><br>
> > > > > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
> > > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > --<br>
> > > ><br>
> > > > Thanks,<br>
> > > ><br>
> > > > Justin Holewinski<br>
> > ><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Justin Holewinski<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>