https://bugs.llvm.org/show_bug.cgi?id=45684
Bug ID: 45684
Summary: Failure to optimize out unary - on right operand of %
when it is not -1
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
int f(int x, int y)
{
__builtin_assume(y != -1);
return x % -y;
}
Here, `x % -y` could be optimized to `x % y`, since `y != -1`. GCC does this
transformation, but LLVM does not.
Comparison here : https://godbolt.org/z/utdr2q
--
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