On Fri, May 31, 2013 at 10:20:01AM +0200, Richard Biener wrote: > The limit is there because a loop with more than one basic-block with code > necessarily has to have conditionally executed BBs and eventually PHI nodes > at merge points. > > Now, it may be that we properly determine if we can handle the PHIs in > the non-header BB and that we properly bail out if we hit a conditional > statement. But especially the latter would mean that we would not vectorize > the loop.
Note that for OpenMP #pragma omp simd as well as Cilk+ #pragma simd we actually want to be able to do more than that in the future, part of it is something that can be done even for normal loops, but part of it would be only if we detected that all iterations (or at least within vf) are completely independent. 1) with better infrastructure we can do at least on some ISAs conditional loads or conditional stores 2) calls to elemental functions (vector attribute in Cilk+, #pragma omp declare simd) if the elemental function allows masking can be also if-converted in some way 3) even if if-conversion of 1) and 2) above doesn't help, for the simd loops we just want to fall back to just running vf scalar iterations of some bb that couldn't be if-converted, where we can have say first and third bb vectorized normally and second run in a loop from 0 to vf - 1, etc. But none of this is anywhere close to the patchlets that have been posted. Jakub