Richard, Here is second part of patch which includes 1. One particular phi node recognition - if phi function has more than 2 arguments but it has only two really different arguments and one argument has the only occurrence. This is important for conditional scalar reduction conversion, e.g. for such test-case; if (a[i] != 0 && b[i] != 0) n++; 2. New sub-pass which repairs bool pattern candidates with multiple uses - such situation occurres if the same predicate (not simple compare) is used for phi node conversion and load/store mask. If for some var participating in tree traversal its def stmt has multiple uses we create copy of this definition with unique left hand side and change one use of original vat to newly created one. We repeat this process until all multiple uses will be deleted. 3. Another sub-pass which delete redundant predicate computations which are dead locally, i.e. local dead code elimination. Note that such dead code can prevent loop vectorization. Changelog: 2014-10-13 Yuri Rumyantsev * tree-if-conv.c (cgraph.h): Add include file to issue error message. (phi_has_two_different_args): New function. (is_cond_scalar_reduction): Add argument EXTENDED to choose access to phi arguments. Invoke phi_has_two_different_args to get phi arguments iff EXTENDED is true. Change check stmt-block is predecessor of phi-block since phi may haave more than two arguments. (convert_scalar_cond_reduction): Add argument BEFORE to insert statement before/after gsi point. (predicate_scalar_phi): Add argument false to call of is_cond_scalar_reduction. Add argument true to call of convert_scalar_cond_reduction. (predicate_arbitrary_scalar_phi): Change result of function to tree representing rhs of new phi replacement stmt. (predicate_extended_scalar_phi): New function. (predicate_all_scalar_phis): Invoke predicate_extended_scalar_phi instead of predicate_arbitrary_scalar_phi. (ifcvt_split_def_stmt): New function. (ifcvt_walk_pattern_tree): New function. (stmt_is_root_of_bool_pattern): New function. (ifcvt_repair_bool_pattern): New function. (ifcvt_local_dce): New function. (tree_if_conversion): Invoke ifcvt_local_dce and ifcvt_repair_bool_pattern under FLAG_FORCE_VECTORIZE.