On Sat, Sep 14, 2013 at 8:10 AM, Xinliang David Li <davi...@google.com> wrote: > tree if conversion is an enabler pass for vectorization, so by > default, it is only turned on when vectorization is on, but may also > depend on the optimization level. Currently, the logic to handle this > is in the gate function which become hard to understand and extend. > > The proposed patch move the logic from the gate function to > 'finish_option' which is much clearer. The downside of this patch is > that function specific optimization node needs to be created for some > cases during omp-lowering.
Something I don't like. What's the issue with checking the has_force_vect_loops flag? How's the argument that the gate is hard to extend? Wouldn't extending it complicate it again and thus make it hard to understand again? That said, given that doing things in finish_options () is discouraged the patch looks like a step backwards. So, can you explain the underlying rationale? Btw, if we think of if-conversion as tied to loop vectorization then we can guard it by it and make a new container pass like NEXT_PASS (pass_loop_vectorizer); PUSH_INSERT_PASSES_WITHIN (pass_loop_vectorizer) NEXT_PASS (pass_if_conversion); NEXT_PASS (pass_vectorize); NEXT_PASS (pass_dce_loop); POP_INSERT_PASSES () and guard pass_loop_vectorizer by flag_tree_loop_vectorize, defaulting if-conversion to be enabled (but allow disabling it manually). Or take the step and move it under control of the vectorizer itself. Richard. > Comments? > > > thanks, > > David