[llvm-bugs] [Bug 51748] New: Unrecognized rotate patterns

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 4 06:05:00 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51748

            Bug ID: 51748
           Summary: Unrecognized rotate patterns
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

unsigned rol1(unsigned x, int y)
{
        return (x << y) | (x >> (64-y)); 
} 

define dso_local i32 @rol1(i32 %0, i32 %1) local_unnamed_addr #0 {
  %3 = shl i32 %0, %1
  %4 = sub nsw i32 64, %1
  %5 = lshr i32 %0, %4
  %6 = or i32 %5, %3
  ret i32 %6
}

--------------------------------

define i32 @src(i32 %0, i32 %1) {
%2:
  %3 = shl i32 %0, %1
  %4 = sub nsw i32 64, %1
  %5 = lshr i32 %0, %4
  %6 = or i32 %5, %3
  ret i32 %6
}
=>
define i32 @tgt(i32 %0, i32 %1) {
%2:
  %3 = fshl i32 %0, i32 %0, i32 %1
  ret i32 %3
}

https://alive2.llvm.org/ce/z/6jDaR_

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210904/23f90e85/attachment-0001.html>


More information about the llvm-bugs mailing list