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: unassignedb...@nondot.org
          Reporter: zvi.racko...@intel.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to