[llvm-bugs] [Bug 30644] New: ROTATE by 1 instruction is preferable over ROTATE with immediate

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Oct 8 11:33:40 PDT 2016


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

            Bug ID: 30644
           Summary: ROTATE by 1 instruction is preferable over ROTATE with
                    immediate
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: zvi.rackover at intel.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

For the following test 

define i32 @rotr1_32(i32 %A) {
     %B = shl i32 %A, 31
     %C = lshr i32 %A, 1
     %D = or i32 %B, %C
     ret i32 %D
 }

We generate:
  roll $31, %eax

It would be better to generate:
  rorl $eax

Rotate by 1 is translated to 1 micro-op, while rotate with imm8 is translated
to 2 micro-ops.

We appear to select to ROL1 instructions, but not the ROR1 instructions.

-- 
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/20161008/e9cf5b6e/attachment.html>


More information about the llvm-bugs mailing list