llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.72k stars 11.41k forks source link

[vectorization] gcc generate better code for a loop body with control flow #64292

Open zhongsir1 opened 1 year ago

zhongsir1 commented 1 year ago

test: https://godbolt.org/z/7Y6a4EvW9

void s1161(void)
{
        for (int i = 0; i < LEN_1D-1; ++i) {
            if (c[i] < (real_t)0.) {
                goto L20;
            }
            a[i] = c[i] + d[i] * e[i];
            goto L10;
L20:
            b[i] = a[i] + d[i] * d[i];
L10:
            ;
        }
}
vfdff commented 1 year ago
vfdff commented 1 year ago
vfdff commented 1 year ago

s1161_ptr is a more simple case, https://godbolt.org/z/xaqacGo81, which may require similar extension as the D114480 for PHINode