On Fri, Sep 07, 2012 at 12:59:26PM -0700, Andi Kleen wrote: > "Iyer, Balaji V" <balaji.v.i...@intel.com> writes: > > > > Yes, I really like this idea and that is kind of what I want. But, how do I > > turn on vectorization on a function by function basis? I tried to set > > flag_tree_vectorize=1 but that doesn't seem to do the trick. > > AFAIK vectorization needs a range of passes to work, so it probably needs full > -O3 or something similar like you did. Apparently the optimize attribute has > some > known problems, but I don't know if it would affect this case.
Nope, -O2 -ftree-vectorize works just fine. Vectorization only needs if-conversion, but that is enabled by default if -ftree-vectorize (unless explicitly disabled). Jakub