--- Comment #5 from Marcin Krotkiewski <marcin.krotkiewski at gmail dot com> ---
(In reply to Jakub Jelinek from comment #4)
> The declare simd on the functions is essentially an implicit loop around the
> whole body, so the function in this cases is passed a V4DFmode argument and
> V4DFmode result and for each of the elements performs the body of the loop.
> Guess we don't vectorize test1 because we fail to unroll the loop for some
Not sure unrolling is the answer. The number of iterations might be arbitrary -
how deep would you unroll it? In either case, each iteration of the loop should
call a vector version of the function, even if no unrolling is done.
It seems that if functions are called inside loops nested within enclosing
vectorized functions, gcc never tries to search for suitable vector candidates.