https://bugs.llvm.org/show_bug.cgi?id=47858
Bug ID: 47858
Summary: Missed simplification with not
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedb...@nondot.org
Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org
void foo(void);
void s(unsigned a, unsigned b)
{
unsigned x = ~b;
if (x > 0 && x > a)
foo();
}
Clang -O3:
s(unsigned int, unsigned int): # @s(unsigned
int, unsigned int)
cmp esi, -1
je .LBB0_2
not esi
cmp esi, edi
jbe .LBB0_2
jmp foo() # TAILCALL
.LBB0_2:
ret
GCC -O3:
s(unsigned int, unsigned int):
not esi
cmp esi, edi
ja .L4
ret
.L4:
jmp foo()
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs