https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91198

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
The first issue to address is

t.c:4:20: note:   Analyze phi: j_26 = PHI <j_10(8), 0(15)>
t.c:4:20: missed:   reduction used in loop.
t.c:4:20: missed:   Unknown def-use cycle pattern.

and then

t.c:4:20: note:   mark relevant 5, live 0: _9 = .MASK_LOAD (_5, 32B, _33, 0.0);
t.c:4:20: note:   vect_is_simple_use: operand j_26 = PHI <j_10(8), 0(15)>, type
of def: unknown
t.c:4:20: missed:   Unsupported pattern.
t.c:6:14: missed:   not vectorized: unsupported use in stmt.
t.c:4:20: missed:  unexpected pattern.
t.c:4:20: note:  ***** Analysis failed with vector mode V16SI

so the compress/expand address evolution and it's compute isn't yet supported.


A related testcase would just store the indices:

void expand(float const * __restrict__ input, 
            int       * __restrict__ output, 
            int size)
{
    float const threshold = 0.5; 
    int o = 0;
    for (int i = 0; i < size; ++i) 
    {
        if (input[i] < threshold) 
        {
            output[i] = o;
            o++;
        }
    }
}

that has just the unsupported "induction" and might be the "easiest" start

t2.c:7:23: note:   Analyze phi: o_21 = PHI <o_6(8), 0(15)>
t2.c:7:23: missed:   reduction used in loop.
t2.c:7:23: missed:   Unknown def-use cycle pattern.

Reply via email to