<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Clang unable to optimize away constant stores to Wi/Xi"
   href="https://bugs.llvm.org/show_bug.cgi?id=45192">45192</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang unable to optimize away constant stores to Wi/Xi
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: AArch64
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>glider@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>arnaud.degrandmaison@arm.com, llvm-bugs@lists.llvm.org, ndesaulniers@google.com, smithp352@googlemail.com, Ties.Stuij@arm.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm seeing a lot of occurrences of the following pattern when compiling an
Android 4.14 kernel with -ftrivial-var-auto-init=pattern:

ffffff8008f3686c:       3201f3e9        mov     w9, #0xaaaaaaaa                
// #-1431655766
ffffff8008f36870:       293327a9        stp     w9, w9, [x29, #-104]
ffffff8008f36874:       b201f3e9        mov     x9, #0xaaaaaaaaaaaaaaaa        
// #-6148914691236517206
ffffff8008f36878:       a93a27a9        stp     x9, x9, [x29, #-96]
ffffff8008f3687c:       a93b27a9        stp     x9, x9, [x29, #-80]


I suppose a more optimal code for this would be:

  mov     x9, #0xaaaaaaaaaaaaaaaa         // #-6148914691236517206
  stp     w9, w9, [x29, #-104]
  stp     x9, x9, [x29, #-96]
  stp     x9, x9, [x29, #-80]</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>