[Bug tree-optimization/77902] Auto-vectorizes epilogue loops of manually vectorized functions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77902 Allan Jensen changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #3 from Allan Jensen --- Since it appears to be optimized better in gcc 7, let's say this is resolved.
[Bug tree-optimization/77902] Auto-vectorizes epilogue loops of manually vectorized functions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77902 --- Comment #2 from Allan Jensen --- While this have been the case in both GCC 5 and GCC 6, it appears to both failing cases previously meantioned already produced the best case result in using a half recent GCC 7. gcc version 7.0.0 20160923 (experimental) (GCC)
[Bug tree-optimization/77902] Auto-vectorizes epilogue loops of manually vectorized functions
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77902 --- Comment #1 from Allan Jensen --- Further experimentation shows that GCC can sometimes reason about the remaining range but does so inconsistenly. For instance this examplse also fails: int result = 0; for (; count >= 4; count -= 4) { // Manually vectorized or batched code foobar_4x(result, vector); vector += 4; } for (; count >= 0; --count) { // Still autovectorized result += *vector++; } But replacing the epilogue with a loop that counts up, and GCC appears to figure out it is pointless to vectorize: for (int i = 0; i < count; ++count) { // correctly not vectorized