[llvm-bugs] [Bug 46895] New: InstCombine - matchRotate doesn't match constant rotation amounts

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 29 09:17:42 PDT 2020


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

            Bug ID: 46895
           Summary: InstCombine - matchRotate doesn't match constant
                    rotation amounts
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: llvm-bugs at lists.llvm.org, spatel+llvm at rotateright.com

define i64 @rot(i64 %a0) {
  %1 = shl i64 %a0, 1
  %2 = lshr i64 %a0, 63
  %3 = or i64 %1, %2
  ret i64 %3
}

I'd expect this to fold to:

define i64 @rot(i64 %a0) {
  %1 = tail call i64 @llvm.fshl.i64(i64 %a0, i64 %a0, i64 1)
  ret i64 %1
}

-- 
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/20200729/2d3e9ca6/attachment.html>


More information about the llvm-bugs mailing list