<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:"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;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
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;}
span.EmailStyle18
        {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>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I’m not sure what you mean by this. The type in memory doesn’t really mean anything, and no information is lost. You can still tell (for optimizations) some information about the underlying IR object from the MachineMemOperand, which is
 mostly used for alias analysis.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-Matt <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Neil Ryan <neilryan@cs.washington.edu><br>
<b>Date: </b>Thursday, April 18, 2019 at 9:59 PM<br>
<b>To: </b>llvm-dev <llvm-dev@lists.llvm.org>, "tstellar@redhat.com" <tstellar@redhat.com>, "Arsenault, Matthew" <Matthew.Arsenault@amd.com><br>
<b>Subject: </b>Re: [llvm-dev] Disable combining of loads and stores in instcombine<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div name="messageBodySection">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">IIRC it’s not strictly possible to determine what array a load/store is based on. I don’t believe the decomposition is always possible, as information is lost when accesses are
 combined.<o:p></o:p></span></p>
</div>
<div name="messageSignatureSection">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif"><br>
Neil<o:p></o:p></span></p>
</div>
<div name="messageReplySection">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">On Apr 17, 2019, 12:31 PM -0700, Arsenault, Matthew <Matthew.Arsenault@amd.com>, wrote:<br>
<br>
<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #1ABC9C 1.0pt;padding:0in 0in 0in 8.0pt;margin-left:3.75pt;margin-top:3.75pt;margin-right:3.75pt;margin-bottom:3.75pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">This is really a codegen problem. You can decompose the load/store however you like in the backend. InstCombine should
 still combine the loads as a canonicalization.<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">-Matt<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black">From:</span></b><span style="font-size:10.5pt;font-family:"Arial",sans-serif">
</span><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:black">llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Reply-To:</b> Neil Ryan <neilryan@cs.washington.edu><br>
<b>Date:</b> Wednesday, April 17, 2019 at 9:28 PM<br>
<b>To:</b> llvm-dev <llvm-dev@lists.llvm.org>, "tstellar@redhat.com" <tstellar@redhat.com><br>
<b>Subject:</b> Re: [llvm-dev] Disable combining of loads and stores in instcombine</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></p>
</div>
<div name="messageBodySection">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">I’m writing a pass for some custom hardware — we’d like to split arrays across hardware elements; this doesn’t work
 if consecutive writes to characters get combined to a word.</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
</div>
<div name="messageReplySection">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">On Apr 16, 2019, 8:17 PM -0700, Tom Stellard <tstellar@redhat.com>, wrote:</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #E67E22 1.0pt;padding:0in 0in 0in 8.0pt;margin-left:3.75pt;margin-top:3.75pt;margin-right:3.75pt;margin-bottom:3.75pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">On 04/16/2019 11:38 AM, Neil Ryan via llvm-dev wrote:</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #3498DB 1.0pt;padding:0in 0in 0in 8.0pt;margin-left:3.75pt;margin-top:3.75pt;margin-right:3.75pt;margin-bottom:3.75pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">LLVM's optimizer combines stores to consecutive characters into a write of a single word. For instance, if I have char A[4]
 and I write some static value to each element, these writes would be combined into a single 32-bit word write. I found this thread <http://llvm.1065342.n5.nabble.com/disabling-combining-load-stores-in-optimizer-td37560.html> from 2009 -- it seems like it wasn't
 possible then. Has anything changed since?</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:"Arial",sans-serif"><br>
Why do you want to disable this optimization?<br>
<br>
-Tom<br>
<br>
<br>
</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #3498DB 1.0pt;padding:0in 0in 0in 8.0pt;margin-left:3.75pt;margin-top:3.75pt;margin-right:3.75pt;margin-bottom:3.75pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">Neil<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
llvm-dev@lists.llvm.org<br>
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</span><span style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.5pt;font-family:"Arial",sans-serif"> </span><span style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>