<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 9/27/19 7:33 AM, Matt Arsenault via
      llvm-dev wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:9D83B63C-5D2E-41D6-AED9-BB2E0918F3FD@gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <br class="">
      <div><br class="">
        <blockquote type="cite" class="">
          <div class="">On Sep 27, 2019, at 09:07, Björn Pettersson A
            via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org"
              class="" moz-do-not-send="true">llvm-dev@lists.llvm.org</a>>
            wrote:</div>
          <br class="Apple-interchange-newline">
          <div class=""><span style="caret-color: rgb(0, 0, 0);
              font-family: Helvetica; font-size: 12px; font-style:
              normal; font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none; float: none; display: inline
              !important;" class="">Obviously we do not store into two
              locations (it is still a single two byte store).</span><br
              style="caret-color: rgb(0, 0, 0); font-family: Helvetica;
              font-size: 12px; font-style: normal; font-variant-caps:
              normal; font-weight: normal; letter-spacing: normal;
              text-align: start; text-indent: 0px; text-transform: none;
              white-space: normal; word-spacing: 0px;
              -webkit-text-stroke-width: 0px; text-decoration: none;"
              class="">
            <span style="caret-color: rgb(0, 0, 0); font-family:
              Helvetica; font-size: 12px; font-style: normal;
              font-variant-caps: normal; font-weight: normal;
              letter-spacing: normal; text-align: start; text-indent:
              0px; text-transform: none; white-space: normal;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              text-decoration: none; float: none; display: inline
              !important;" class="">So is it (always) correct to
              interpret the list of MachineMemOperands as the
              instruction will store to one of the locations?</span></div>
        </blockquote>
      </div>
      <div class=""><br class="">
      </div>
      I think it’s bug to have multiple memory operands if the
      instruction only accesses one location. The operands should have
      been merged in some way unless the instruction can truly access
      two distinct addresses</blockquote>
    <p>I'm a bit less sure of this.  It's on the surface reasonable, but
      there are some interesting questions.<br>
    </p>
    <p>We definitely interpret a list of MMOs as indicating a set of
      locations which are possibly(?) accessed.  The only piece I'm
      unsure about is that the existence of an MMO requires the access
      occurs.  If we do, that raises some interesting consistency
      questions for cases such as:</p>
    <ul>
      <li>Load/Store merging (a superset of the branch folding case)</li>
      <li>Predicate loads and stores (since the access may not happen)</li>
      <li>Load/stores in dead code (i.e. the typical UB contradiction
        cases)</li>
      <li>Instructions w/multiple accesses to the same MMO combined
        w/constant memory to imm folding which only handles some cases</li>
    </ul>
    <p>I'm tempted to suggest we treat the list of MMOs as a potential
      superset of the implied access, not a direct one-to-one mapping.</p>
    <p>(None of this should imply branch folding shouldn't merge the
      MMOs.  That would just become an optimization quality issue, not a
      correctness one.)<br>
    </p>
    <p>Philip<br>
    </p>
    <p><br>
    </p>
    <blockquote type="cite"
      cite="mid:9D83B63C-5D2E-41D6-AED9-BB2E0918F3FD@gmail.com">
      <div class=""><br class="">
      </div>
      <div class="">-Matt</div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-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="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
  </body>
</html>