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: [email protected]
ReportedBy: [email protected]
CC: [email protected]
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
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs