<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 14 (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:0cm;
        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.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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="SV" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Ryan,<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 lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">We maintain internally a number of patches (towards trunk) to support 16-bit bytes in LLVM (not Clang). I can provide them upon request. Disclaimer:
 They work for us. Some are good, others ugly or incomplete.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">/Patrik Hägglund<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>Ryan Taylor<br>
<b>Sent:</b> den 6 mars 2015 22:41<br>
<b>To:</b> Ahmed Bougacha<br>
<b>Cc:</b> llvmdev@cs.uiuc.edu<br>
<b>Subject:</b> Re: [LLVMdev] ReduceLoadWidth, DAGCombiner and non 8bit loads/extloads question.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Ahmed,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">  Ok, thanks. I'm not sure at this point the extend of LLVM's dependence on the requirement of 8-bit byte-addressing and how extensive that patch would have to be.
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">  If we made the changes, we would keep it local to us until at which time we could add our target, I would presume anyways, though that's not exactly my call, though even so I would think the more important issue for testing in-tree would
 be to make sure it didn't break any existing tests on existing targets but yes, that too. :)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks again.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Fri, Mar 6, 2015 at 1:18 PM, Ahmed Bougacha <<a href="mailto:ahmed.bougacha@gmail.com" target="_blank">ahmed.bougacha@gmail.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">On Thu, Mar 5, 2015 at 4:19 PM, Ryan Taylor <<a href="mailto:ryta1203@gmail.com">ryta1203@gmail.com</a>> wrote:<br>
> Thanks for the reply:<br>
><br>
> So should LLVM continue to assume 8-bit byte addressing? It would be nice,<br>
> not only to us but potential future machines, to have a permanent fix to<br>
> this assumption? This sounds reasonable yes?<br>
><br>
> Marking them as Custom in XXXISelLowering still produces error, the<br>
> pre-legalize phase is still going to opt to LD1 since it's not caring about<br>
> target-specifics. Then, again, we'll be stuck trying to undo the addressing.<br>
><br>
> I see what you mean about the DAGCombiner, that's a two part solution, first<br>
> turning them into target-specific before any opts in pre-legalize and then<br>
> back before any opts in post-legalize. Certainly a potential solution,<br>
> though we may lose some optimization opportunities, even on valid loads, as<br>
> you mention.<br>
><br>
> The ultimate issue here, for us, is that LLVM makes the assumption that<br>
> every machine is going to support 8-bit byte-addressing. I'm not sure this<br>
> is a solid or even reasonable assumption going forward?<br>
<br>
Short version: Patches welcome ;)   Long version: in general, if<br>
something is not supported yet, it means no one needed it, so no one<br>
put the work into it.  If you're willing to do so, I'd approve of<br>
fixing the various parts that assume this (if it's only DAGCombines<br>
that's fine).  Then there's the problem of how to test this in-tree<br>
when no in-tree target has these problems (Krzysztof mentions Hexagon,<br>
do you both have the same problem?).  But that's another conversation!<br>
<br>
> Possibly, we could just pseudo support it and expand it later, but the<br>
> addressing would still be an issue, I believe.<br>
<br>
You might want to look into MachineMemOperands, which tracks the<br>
memory object a load/store points into.  It could help with the<br>
expansion.<br>
<span style="color:#888888"><br>
<span class="hoenzb">-Ahmed</span></span><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>