This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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 <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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]