https://bugs.llvm.org/show_bug.cgi?id=48643
Bug ID: 48643
Summary: Missed opportunity for value range propagation from
binary ops
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]
extern void foo (void);
void
foo (unsigned int x, unsigned int y)
{
unsigned int min;
if (x >= 3 && x <= 6)
return;
if (y >= 5 && y <= 8)
return;
min = x < y ? x : y;
if (min == 5)
foo ();
if (min == 6)
foo ();
}
LLVM (even with experimental CE pass)
foo(unsigned int, unsigned int): # @foo(unsigned int, unsigned int)
lea eax, [rdi - 3]
cmp eax, 4
jb .LBB0_4
lea eax, [rsi - 5]
cmp eax, 4
jb .LBB0_4
cmp edi, esi
cmovb esi, edi
cmp esi, 6
je .LBB0_5
cmp esi, 5
jne .LBB0_4
.LBB0_5:
jmp foo() # TAILCALL
.LBB0_4:
ret
GCC:
foo(unsigned int, unsigned int):
ret
https://godbolt.org/z/sMc4s7
--
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