[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-bugs
Subject:    [LLVMbugs] [Bug 7525] New: bswap optimization broken in InstCombine
From:       bugzilla-daemon () llvm ! org
Date:       2010-06-29 21:44:06
Message-ID: bug-7525-206 () http ! llvm ! org/bugs/
[Download RAW message or body]

http://llvm.org/bugs/show_bug.cgi?id=7525

           Summary: bswap optimization broken in InstCombine
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs@nondot.org
        ReportedBy: echristo@gmail.com
                CC: llvmbugs@cs.uiuc.edu


Filing this so I don't forget about it.

With this small testcase:

int f(int n)
{
  return (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >>
24));
}

We should be getting a 32-bit bswap, but instead are getting the long sequence
of ands, ors, and shifts.


        movl    %esp, %ebp
        movl    8(%ebp), %eax
        movl    %eax, %ecx
        sarl    $24, %ecx
        movl    %eax, %edx
        shll    $24, %edx
        orl     %ecx, %edx
        movl    %eax, %ecx
        shrl    $8, %ecx
        andl    $65280, %ecx            ## imm = 0xFF00
        orl     %edx, %ecx
        shll    $8, %eax
        andl    $16711680, %eax         ## imm = 0xFF0000
        orl     %ecx, %eax

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
LLVMbugs@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic