Hi, In gimple_expand_vec_cond_expr: icode = get_vcond_icode (mode, cmp_op_mode, unsignedp); if (icode == CODE_FOR_nothing) { if (tcode == LT_EXPR && op0a == op0) { /* A VEC_COND_EXPR condition could be folded from EQ_EXPR/NE_EXPR into a constant when only get_vcond_eq_icode is supported. Try changing it to NE_EXPR. */ tcode = NE_EXPR; } if ((tcode == EQ_EXPR || tcode == NE_EXPR) && direct_internal_fn_supported_p (IFN_VCONDEQ, TREE_TYPE (lhs), TREE_TYPE (op0a), OPTIMIZE_FOR_BOTH)) { tree tcode_tree = build_int_cst (integer_type_node, tcode); return gimple_build_call_internal (IFN_VCONDEQ, 5, op0a, op0b, op1, op2, tcode_tree); } }
if (icode == CODE_FOR_nothing) { gcc_assert (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (op0)) && can_compute_op0 && (get_vcond_mask_icode (mode, TYPE_MODE (TREE_TYPE (op0))) != CODE_FOR_nothing)); return gimple_build_call_internal (IFN_VCOND_MASK, 3, op0, op1, op2); } It seems the second check for icode == COND_FOR_nothing is redundant, since icode is not reassigned in the previous block ? The attached patch removes the second if condition. OK to commit after bootstrap+test ? Thanks, Prathamesh
foo.diff
Description: Binary data