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: unassignedb...@nondot.org
          Reporter: david.bolvan...@gmail.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to