This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/77902] Auto-vectorizes epilogue loops of manually vectorized functions
- From: "linux at carewolf dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 10 Oct 2016 23:05:50 +0000
- Subject: [Bug tree-optimization/77902] Auto-vectorizes epilogue loops of manually vectorized functions
- Auto-submitted: auto-generated
- References: <bug-77902-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77902
--- Comment #1 from Allan Jensen <linux at carewolf dot com> ---
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