https://bugs.llvm.org/show_bug.cgi?id=45687
Bug ID: 45687
Summary: Failure to optimize away abs check based on known
range of variable
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedb...@nondot.org
Reporter: gabrav...@gmail.com
CC: llvm-bugs@lists.llvm.org
void g();
void f(int i)
{
__builtin_assume(i >= -1 && i <= 1);
if (abs(i) > 1)
g();
}
This can all be optimized out. GCC does this transformation, LLVM does not.
Comparison here : https://godbolt.org/z/cLcicG
--
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