https://bugs.llvm.org/show_bug.cgi?id=47237
Bug ID: 47237
Summary: Failure to optimize simple selection properly, somehow
the code degenerates
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
int f(int x, int y)
{
return (x & y) == 0 ? x & ~y : x;
}
GCC outputs this :
f(int, int):
andn edx, esi, edi
mov eax, edi
test edi, esi
cmove eax, edx
ret
And LLVM outputs this :
f(int, int): # @f(int, int)
mov ecx, esi
and ecx, edi
not esi
xor eax, eax
cmp ecx, 1
sbb eax, eax
not eax
or eax, esi
and eax, edi
ret
Most likely some sort of transformation in LLVM makes this code completely
degenerate into the result given here.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs