https://bugs.llvm.org/show_bug.cgi?id=48516
Bug ID: 48516
Summary: Failure to optimize loop that does nothing and ends
when result is used in comparison that is optimized
out
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 f(int *x, int *y)
{
long res = 0;
for (int i = 0; i < 100; i++)
res += x[i] * y[i];
if (res != 0)
__builtin_abort();
__builtin_unreachable();
}
This entire function can be optimized into `abort()`. This transformation is
done by GCC, but not by LLVM.
See also comparison here : https://godbolt.org/z/anzYMa
--
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