<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:llvm-dev@redking.me.uk" title="Simon Pilgrim <llvm-dev@redking.me.uk>"> <span class="fn">Simon Pilgrim</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Failure to avoid emitting a useless instruction when doing combined shits and rotates with a smaller result"
   href="https://bugs.llvm.org/show_bug.cgi?id=46138">bug 46138</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Fixed By Commit(s)</td>
           <td>
                
           </td>
           <td>e1d4ca00094a4267b6fd70f613f2e0390b2a8cbf
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Failure to avoid emitting a useless instruction when doing combined shits and rotates with a smaller result"
   href="https://bugs.llvm.org/show_bug.cgi?id=46138#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Failure to avoid emitting a useless instruction when doing combined shits and rotates with a smaller result"
   href="https://bugs.llvm.org/show_bug.cgi?id=46138">bug 46138</a>
              from <span class="vcard"><a class="email" href="mailto:llvm-dev@redking.me.uk" title="Simon Pilgrim <llvm-dev@redking.me.uk>"> <span class="fn">Simon Pilgrim</span></a>
</span></b>
        <pre>Constant rotations are now folded to llvm.fshl in InstCombine:

define i32 @fi32 %0) {
  %2 = load i64, i64* @_ZZ1fjE1x, align 8
  %3 = add i64 %2, 1
  %4 = tail call i64 @llvm.fshl.i64(i64 %3, i64 %3, i64 32)
  store i64 %4, i64* @_ZZ1fjE1x, align 8
  %5 = trunc i64 %4 to i32
  ret i32 %5
}
declare i64 @llvm.fshl.i64(i64, i64, i64)


f:
  movq    _ZZ1fjE1x(%rip), %rax
  incq    %rax
  rorxq   $32, %rax, %rax
  movq    %rax, _ZZ1fjE1x(%rip)
  retq</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>