<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 09/08/2015 07:21 AM, Benoit Belley
      via llvm-dev wrote:<br>
    </div>
    <blockquote cite="mid:D2146725.50382%25benoit.belley@autodesk.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif;
        font-size: 16px;">
        Hi everyone,</div>
      <div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif;
        font-size: 16px;">
        <br>
      </div>
      <div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif;
        font-size: 16px;">
        We have noticed that the SROA pass will only eliminate ‘alloca’
        instructions if those are located in the entry basic block of a
        function.</div>
      <div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif;
        font-size: 16px;">
        <br>
      </div>
      <div><i><font face="Calibri,sans-serif"><b>As a general
              recommendation, should the LLVM IR emitted by our compiler
              always place ‘alloca’ instructions in the entry basic
              block ? (I couldn’t find any recommendations concerning
              this matter.)</b></font></i></div>
    </blockquote>
    <font face="Calibri,sans-serif">Yes.  </font><br>
    <font face="Calibri,sans-serif"><i><b><br>
        </b></i></font>
    <blockquote cite="mid:D2146725.50382%25benoit.belley@autodesk.com"
      type="cite">
      <div><i><font face="Calibri,sans-serif"><br>
          </font></i></div>
      <div><font face="Calibri,sans-serif">In addition, we have noticed
          that the MemCpy pass will attempt to copy LLVM struct using
          moves that are as large as possible. </font>For example, a
        struct of 3 floats is copied using a 64-bit and a 32-bit move.
        It is therefore important that such a struct be aligned on
        8-byte boundary, not just 4 bytes! Else, one runs the risk of
        triggering store-forwarding failure pipelining stalls (which we
        did encountered really badly with one of our internal
        performance benchmark).</div>
    </blockquote>
    This sounds like a bug to me.  We shouldn't be using the large
    load/stores without knowing they're aligned or that unaligned access
    is fast on a particular target.  Where this is best fixed (memcpy,
    store lowering?) I don't know.  <br>
    <blockquote cite="mid:D2146725.50382%25benoit.belley@autodesk.com"
      type="cite">
      <div><br>
      </div>
      <div><b><i>Is there any guidelines for specifying the alignment of
            LLVM structs allocated by alloca instructions ? Is rounding
            down to the structure size to the next power of 2 a good
            strategy ? Will the MemCpy pass issue moves of up to
            64-bytes on AVX-512 capable processors ?</i></b></div>
      <div><b><i><br>
          </i></b></div>
      <div>Cheers,</div>
      <div>Benoit<i style="font-weight: bold;"> </i></div>
      <div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif;
        font-size: 16px;">
        <br>
      </div>
      <div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif;
        font-size: 16px;">
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><b><span style="font-size: 9pt; font-family: Arial,
              sans-serif; color: rgb(99, 99, 99);">Benoit Belley</span></b><span
            style="font-size: 9pt; "><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><span style="font-size: 7.5pt; font-family: Arial,
            sans-serif; color: rgb(146, 147, 150);">Sr Principal
            Developer</span><span style="font-size: 7.5pt; font-family:
            Arial, sans-serif;"><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><span style="font-size: 7.5pt; font-family: Arial,
            sans-serif; color: rgb(146, 147, 150);">M&E-Product
            Development Group</span><span style="font-size: 7.5pt;
            font-family: Arial, sans-serif;"><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><span style="font-size: 7.5pt; font-family: Arial,
            sans-serif;"> </span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><b><span style="font-size: 7pt; font-family: Arial,
              sans-serif; color: rgb(146, 147, 150);">MAIN</span></b><span
            style="font-size: 7.5pt; font-family: Arial, sans-serif;
            color: rgb(146, 147, 150);"> +1 514 393 1616</span><span
            style="font-size: 7.5pt; font-family: Arial, sans-serif;"><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><b><span style="font-size: 7pt; font-family: Arial,
              sans-serif; color: rgb(146, 147, 150);">DIRECT</span></b><span
            style="font-size: 7.5pt; font-family: Arial, sans-serif;
            color: rgb(146, 147, 150);"> +1 438 448 6304</span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><b><span style="font-size: 7pt; font-family: Arial,
              sans-serif; color: rgb(146, 147, 150);">FAX</span></b><span
            style="font-size: 7.5pt; font-family: Arial, sans-serif;
            color: rgb(146, 147, 150);"> +1 514 393 0110</span><span
            style="font-size: 7.5pt; font-family: Arial, sans-serif;"><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><span style="font-size: 7.5pt; font-family: Arial,
            sans-serif;"> </span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><a moz-do-not-send="true"
            href="http://twitter.com/autodesk" style="color: purple; "><span
              style="font-size: 7.5pt; font-family: Arial, sans-serif;
              color: rgb(146, 147, 150);">Twitter</span></a><span
            style="font-size: 7.5pt; font-family: Arial, sans-serif;
            color: rgb(146, 147, 150);"><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><a moz-do-not-send="true"
            href="https://www.facebook.com/Autodesk" style="color:
            purple; "><span style="font-size: 7.5pt; font-family: Arial,
              sans-serif; color: rgb(146, 147, 150);">Facebook</span></a><span
            style="font-size: 7.5pt; font-family: Arial, sans-serif;
            color: rgb(146, 147, 150);"><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><span style="font-size: 7.5pt; font-family: Arial,
            sans-serif;"> </span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><b><span style="font-size: 7.5pt; font-family: Arial,
              sans-serif; color: rgb(146, 147, 150);">Autodesk, Inc.</span></b><span
            style="font-size: 7.5pt; font-family: Arial, sans-serif;"><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><span style="font-size: 7.5pt; font-family: Arial,
            sans-serif; color: rgb(146, 147, 150);">10 Duke Street</span><span
            style="font-size: 7.5pt; font-family: Arial, sans-serif;"><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><span style="font-size: 7.5pt; font-family: Arial,
            sans-serif; color: rgb(146, 147, 150);">Montreal, Quebec,
            Canada H3C 2L7</span><span style="font-size: 7.5pt;
            font-family: Arial, sans-serif;"><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><a moz-do-not-send="true"
            href="http://www.autodesk.com/" style="color: purple; "><span
              style="font-size: 7.5pt; font-family: Arial, sans-serif;
              color: rgb(146, 147, 150);">www.autodesk.com</span></a><span
            style="color: rgb(146, 147, 150); "><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><span style="font-size: 7.5pt; font-family: Arial,
            sans-serif; color: rgb(146, 147, 150);"> </span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt; "><img id="Picture_x0020_1"
            src="cid:part4.04080103.05030000@philipreames.com"
            alt="Description: Email_Signature_Logobar" type="image/png"
            height="41" width="283" border="0"><o:p></o:p></p>
        <div style="font-family: Calibri; font-size: medium; ">
          <p class="MsoNormal" style="margin: 0in 0in 0.0001pt;
            font-size: 11pt; font-family: Calibri, sans-serif; ">
            <span style="font-size: 11.5pt; "> </span></p>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>