*** tree-vectorizer.c Tue Jan 4 12:31:08 2005 --- tree-vectorizer.patch4++.c Tue Jan 4 12:28:25 2005 *************** static bool vect_analyze_offset_expr *** 236,241 **** --- 236,242 ---- (tree, struct loop *, tree, tree *, tree *, tree *); static void vect_pattern_recog_1 (tree (* ) (tree, varray_type), block_stmt_iterator); + static tree vect_strip_conversion (tree); /* Utility functions for the code transformation. */ static tree vect_create_destination_var (tree, tree); *************** vect_debug_details (struct loop *loop) *** 1428,1434 **** /* Function vect_get_ptr_offset ! Compute the OFFSET modulo vector-type alignment of pointer REF in bits. */ static tree vect_get_ptr_offset (tree ref, tree vectype, tree *offset) --- 1429,1435 ---- /* Function vect_get_ptr_offset ! Compute the OFFSET modulo vector-type alignment of pointer REF in bytes. */ static tree vect_get_ptr_offset (tree ref, tree vectype, tree *offset) *************** vect_get_ptr_offset (tree ref, tree vect *** 1454,1463 **** { /* Compute the offset for vectype. */ ptr_offset = ptr_offset % TYPE_ALIGN (vectype); ! /* In bits. */ ! ptr_offset = ptr_offset * BITS_PER_UNIT; ! *offset = fold_convert (unsigned_type_node, ! build_int_cst (NULL_TREE, ptr_offset)); return ref; } else --- 1455,1461 ---- { /* Compute the offset for vectype. */ ptr_offset = ptr_offset % TYPE_ALIGN (vectype); ! *offset = size_int (ptr_offset); return ref; } else *************** vect_get_ptr_offset (tree ref, tree vect *** 1472,1477 **** --- 1470,1501 ---- } + /* Function vect_strip_conversions + + Strip conversions that don't narrow the mode. */ + + static tree + vect_strip_conversion (tree expr) + { + tree to, ti, oprnd0; + + while (TREE_CODE (expr) == NOP_EXPR || TREE_CODE (expr) == CONVERT_EXPR) + { + to = TREE_TYPE (expr); + oprnd0 = TREE_OPERAND (expr, 0); + ti = TREE_TYPE (oprnd0); + + if (!INTEGRAL_TYPE_P (to) || !INTEGRAL_TYPE_P (ti)) + return NULL_TREE; + if (GET_MODE_SIZE (TYPE_MODE (to)) < GET_MODE_SIZE (TYPE_MODE (ti))) + return NULL_TREE; + + expr = oprnd0; + } + return expr; + } + + /* Function vect_analyze_offset_expr Given an offset expression EXPR received from get_inner_reference, analyze *************** vect_analyze_offset_expr (tree expr, *** 1521,1536 **** tree left_step = size_zero_node; tree right_step = size_zero_node; enum tree_code code; ! tree init, evolution, tmp, def_stmt; ! STRIP_NOPS (expr); /* Stop conditions: 1. Constant. */ ! if (host_integerp (expr, 1)) { ! *initial_offset = expr; ! *misalign = expr; *step = size_zero_node; return true; } --- 1545,1567 ---- tree left_step = size_zero_node; tree right_step = size_zero_node; enum tree_code code; ! tree init, evolution, def_stmt; ! *step = NULL_TREE; ! *misalign = NULL_TREE; ! *initial_offset = NULL_TREE; ! ! /* Strip conversions that don't narrow the mode. */ ! expr = vect_strip_conversion (expr); ! if (!expr) ! return false; /* Stop conditions: 1. Constant. */ ! if (TREE_CODE (expr) == INTEGER_CST) { ! *initial_offset = fold_convert (sizetype, expr); ! *misalign = fold_convert (sizetype, expr); *step = size_zero_node; return true; } *************** vect_analyze_offset_expr (tree expr, *** 1540,1579 **** if (SSA_VAR_P (expr)) { tree access_fn = analyze_scalar_evolution (loop, expr); - if (access_fn == chrec_dont_know /* No access_fn. */ ! /* Not enough information: may be not loop invariant. ! E.g., for a[b[i]], we get a[D], where D=b[i]. EXPR is D, its ! initial_condition is D, but it depends on i - loop's induction ! variable. */ ! || (((init = initial_condition_in_loop_num (access_fn, loop->num)) ! == expr) ! && !IS_EMPTY_STMT (def_stmt = SSA_NAME_DEF_STMT (init)) ! && flow_bb_inside_loop_p (loop, bb_for_stmt (def_stmt))) ! /* Evolution is not constant. */ ! || ((evolution = evolution_part_in_loop_num (access_fn, loop->num)) ! && !host_integerp (evolution, 0))) { ! *step = NULL_TREE; ! *misalign = NULL_TREE; ! *initial_offset = NULL_TREE; ! return false; } ! if (host_integerp (init, 0)) ! *misalign = init; else /* Not constant, misalignment cannot be calculated. */ *misalign = NULL_TREE; ! *initial_offset = init; ! *step = evolution ? evolution : size_zero_node; return true; } /* Recursive computation. */ oprnd0 = TREE_OPERAND (expr, 0); oprnd1 = TREE_OPERAND (expr, 1); --- 1571,1623 ---- if (SSA_VAR_P (expr)) { tree access_fn = analyze_scalar_evolution (loop, expr); ! if (access_fn == chrec_dont_know) ! /* No access_fn. */ ! return false; ! init = initial_condition_in_loop_num (access_fn, loop->num); ! if (init == expr) { ! def_stmt = SSA_NAME_DEF_STMT (init); ! if (def_stmt ! && !IS_EMPTY_STMT (def_stmt) ! && flow_bb_inside_loop_p (loop, bb_for_stmt (def_stmt))) ! /* Not enough information: may be not loop invariant. ! E.g., for a[b[i]], we get a[D], where D=b[i]. EXPR is D, its ! initial_condition is D, but it depends on i - loop's induction ! variable. */ ! return false; } ! evolution = evolution_part_in_loop_num (access_fn, loop->num); ! if (evolution && TREE_CODE (evolution) != INTEGER_CST) ! /* Evolution is not constant. */ ! return false; ! ! if (TREE_CODE (init) == INTEGER_CST) ! *misalign = fold_convert (sizetype, init); else /* Not constant, misalignment cannot be calculated. */ *misalign = NULL_TREE; ! *initial_offset = fold_convert (sizetype, init); ! *step = evolution ? fold_convert (sizetype, evolution) : size_zero_node; return true; } /* Recursive computation. */ + if (!BINARY_CLASS_P (expr)) + { + /* We expect to get binary expressions (PLUS/MINUS and MULT). */ + if (vect_debug_details (NULL)) + { + fprintf (dump_file, "Not binary expression "); + print_generic_expr (dump_file, expr, TDF_SLIM); + } + return false; + } oprnd0 = TREE_OPERAND (expr, 0); oprnd1 = TREE_OPERAND (expr, 1); *************** vect_analyze_offset_expr (tree expr, *** 1581,1609 **** &left_misalign, &left_step) || !vect_analyze_offset_expr (oprnd1, loop, vectype_alignment, &right_offset, &right_misalign, &right_step)) - { - *step = NULL_TREE; - *misalign = NULL_TREE; - *initial_offset = NULL_TREE; return false; - } /* The type of the operation: plus, minus or mult. */ code = TREE_CODE (expr); switch (code) { case MULT_EXPR: ! /* Assumption: in MULT_EXPR the left operand is a variable and the right ! operand is a constant. Therefore, LEFT_OFFSET can be either a variable ! or a constant, and RIGHT_OFFSET is always a constant. */ /* Misalignment computation. */ if (SSA_VAR_P (left_offset)) { /* If the left side contains variable that cannot be substituted with constant, we check if the right side is a multiple of ALIGNMENT. */ ! if (integer_zerop (int_const_binop (TRUNC_MOD_EXPR, right_offset, ! vectype_alignment, 0))) *misalign = size_zero_node; else /* If the remainder is not zero or the right side isn't constant, we --- 1625,1654 ---- &left_misalign, &left_step) || !vect_analyze_offset_expr (oprnd1, loop, vectype_alignment, &right_offset, &right_misalign, &right_step)) return false; /* The type of the operation: plus, minus or mult. */ code = TREE_CODE (expr); switch (code) { case MULT_EXPR: ! if (TREE_CODE (right_offset) != INTEGER_CST) ! /* RIGHT_OFFSET can be not constant. For example, for arrays of variable ! sized types. ! FORNOW: We don't support such cases. */ ! return false; + /* Strip conversions that don't narrow the mode. */ + left_offset = vect_strip_conversion (left_offset); + if (!left_offset) + return false; /* Misalignment computation. */ if (SSA_VAR_P (left_offset)) { /* If the left side contains variable that cannot be substituted with constant, we check if the right side is a multiple of ALIGNMENT. */ ! if (integer_zerop (size_binop (TRUNC_MOD_EXPR, right_offset, ! vectype_alignment))) *misalign = size_zero_node; else /* If the remainder is not zero or the right side isn't constant, we *************** vect_analyze_offset_expr (tree expr, *** 1614,1641 **** { /* The left operand was successfully substituted with constant. */ if (left_misalign) ! /* In case of EXPR '(i * C1 + j) * C2', LEFT_MISALIGN is NULL_TREE. */ ! *misalign = int_const_binop (code, left_misalign, ! right_misalign, 1); else *misalign = NULL_TREE; } /* Step calculation. */ /* Multiply the step by the right operand. */ ! *step = int_const_binop (PLUS_EXPR, *step, ! int_const_binop (MULT_EXPR, left_step, ! right_offset, 1), ! 1); break; case PLUS_EXPR: case MINUS_EXPR: /* Combine the recursive calculations for step and misalignment. */ ! *step = int_const_binop (code, left_step, right_step, 1); if (left_misalign && right_misalign) ! *misalign = int_const_binop (code, left_misalign, right_misalign, 1); else *misalign = NULL_TREE; --- 1659,1683 ---- { /* The left operand was successfully substituted with constant. */ if (left_misalign) ! /* In case of EXPR '(i * C1 + j) * C2', LEFT_MISALIGN is ! NULL_TREE. */ ! *misalign = size_binop (code, left_misalign, right_misalign); else *misalign = NULL_TREE; } /* Step calculation. */ /* Multiply the step by the right operand. */ ! *step = size_binop (MULT_EXPR, left_step, right_offset); break; case PLUS_EXPR: case MINUS_EXPR: /* Combine the recursive calculations for step and misalignment. */ ! *step = size_binop (code, left_step, right_step); if (left_misalign && right_misalign) ! *misalign = size_binop (code, left_misalign, right_misalign); else *misalign = NULL_TREE; *************** vect_analyze_offset_expr (tree expr, *** 1646,1654 **** } /* Compute offset. */ ! tmp = fold (build2 (code, TREE_TYPE (left_offset), left_offset, right_offset)); ! *initial_offset = fold (build2 (PLUS_EXPR, TREE_TYPE (left_offset), ! *initial_offset, tmp)); return true; } --- 1688,1698 ---- } /* Compute offset. */ ! *initial_offset = fold_convert (sizetype, ! fold ( ! build2 (code, TREE_TYPE (left_offset), ! left_offset, ! right_offset))); return true; } *************** vect_get_base_and_offset (struct data_re *** 1708,1719 **** tree poffset; enum machine_mode pmode; int punsignedp, pvolatilep; ! tree bit_pos, bit_pos_in_bytes; struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo); - tree align; - tree bit_offset; - tree unit_bits = fold_convert (unsigned_type_node, - build_int_cst (NULL_TREE, BITS_PER_UNIT)); *base_aligned_p = false; --- 1752,1759 ---- tree poffset; enum machine_mode pmode; int punsignedp, pvolatilep; ! tree bit_pos_in_bytes; struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo); *base_aligned_p = false; *************** vect_get_base_and_offset (struct data_re *** 1749,1809 **** return expr; case INTEGER_CST: ! *initial_offset = expr; ! *misalign = expr; *step = size_zero_node; return expr; /* These cases continue the recursion: */ - case COMPONENT_REF: - case ARRAY_REF: - /* Find the base and the offset from it. */ - next_ref = get_inner_reference (expr, &pbitsize, &pbitpos, &poffset, - &pmode, &punsignedp, &pvolatilep); - if (!next_ref) - return NULL_TREE; - - align = fold_convert (unsigned_type_node, - build_int_cst (NULL_TREE, - GET_MODE_SIZE (TYPE_MODE (vectype)))); - if (poffset - && !vect_analyze_offset_expr (poffset, loop, align, &this_offset, - &this_misalign, &this_step)) - { - /* Failed to compute offset or step. */ - *step = NULL_TREE; - *initial_offset = NULL_TREE; - *misalign = NULL_TREE; - return NULL_TREE; - } - - /* Add bit position to OFFSET and MISALIGN. */ - - bit_pos = build_int_cst (NULL_TREE, pbitpos); - bit_pos_in_bytes = int_const_binop (TRUNC_DIV_EXPR, bit_pos, - unit_bits, 1); - /* Check that there is no remainder in bits. */ - bit_offset = int_const_binop (TRUNC_MOD_EXPR, bit_pos, unit_bits, 1); - if (!integer_zerop (bit_offset)) - { - if (vect_debug_details (NULL)) - { - fprintf (dump_file, "bit offset alignment: "); - print_generic_expr (dump_file, bit_offset, TDF_SLIM); - } - return NULL_TREE; - } - this_offset = fold (build2 (PLUS_EXPR, TREE_TYPE (this_offset), - this_offset, - bit_pos_in_bytes)); - if (this_misalign) - this_misalign = int_const_binop (PLUS_EXPR, this_misalign, - bit_pos_in_bytes, 1); - - /* Continue the recursion to refine the base (get-inner_reference returns - &a for &a[i], and not a). */ - break; - case ADDR_EXPR: oprnd0 = TREE_OPERAND (expr, 0); next_ref = oprnd0; --- 1789,1800 ---- return expr; case INTEGER_CST: ! *initial_offset = fold_convert (sizetype, expr); ! *misalign = fold_convert (sizetype, expr); *step = size_zero_node; return expr; /* These cases continue the recursion: */ case ADDR_EXPR: oprnd0 = TREE_OPERAND (expr, 0); next_ref = oprnd0; *************** vect_get_base_and_offset (struct data_re *** 1835,1841 **** break; default: ! return NULL_TREE; } base = vect_get_base_and_offset (dr, next_ref, vectype, loop_vinfo, --- 1826,1871 ---- break; default: ! if (!handled_component_p (expr)) ! /* Unsupported expression. */ ! return NULL_TREE; ! ! /* Find the base and the offset from it. */ ! next_ref = get_inner_reference (expr, &pbitsize, &pbitpos, &poffset, ! &pmode, &punsignedp, &pvolatilep); ! if (!next_ref) ! return NULL_TREE; ! ! if (poffset ! && !vect_analyze_offset_expr (poffset, loop, TYPE_SIZE_UNIT (vectype), ! &this_offset, &this_misalign, ! &this_step)) ! { ! /* Failed to compute offset or step. */ ! *step = NULL_TREE; ! *initial_offset = NULL_TREE; ! *misalign = NULL_TREE; ! return NULL_TREE; ! } ! ! /* Add bit position to OFFSET and MISALIGN. */ ! ! bit_pos_in_bytes = size_int (pbitpos/BITS_PER_UNIT); ! /* Check that there is no remainder in bits. */ ! if (pbitpos%BITS_PER_UNIT) ! { ! if (vect_debug_details (NULL)) ! fprintf (dump_file, "bit offset alignment."); ! return NULL_TREE; ! } ! this_offset = fold (size_binop (PLUS_EXPR, bit_pos_in_bytes, ! fold_convert (sizetype, this_offset))); ! if (this_misalign) ! this_misalign = size_binop (PLUS_EXPR, this_misalign, bit_pos_in_bytes); ! ! /* Continue the recursion to refine the base (get_inner_reference returns ! &a for &a[i], and not a). */ ! break; } base = vect_get_base_and_offset (dr, next_ref, vectype, loop_vinfo, *************** vect_get_base_and_offset (struct data_re *** 1845,1861 **** { /* Combine the results. */ if (this_misalign && *misalign) ! { ! *misalign = int_const_binop (PLUS_EXPR, *misalign, this_misalign, 1); ! if (!host_integerp (*misalign, 1) || TREE_OVERFLOW (*misalign)) ! return NULL_TREE; ! } else *misalign = NULL_TREE; ! *step = int_const_binop (PLUS_EXPR, *step, this_step, 1); ! if (!host_integerp (*step, 1) || TREE_OVERFLOW (*step)) ! return NULL_TREE; *initial_offset = fold (build2 (PLUS_EXPR, TREE_TYPE (*initial_offset), *initial_offset, this_offset)); --- 1875,1885 ---- { /* Combine the results. */ if (this_misalign && *misalign) ! *misalign = size_binop (PLUS_EXPR, *misalign, this_misalign); else *misalign = NULL_TREE; ! *step = size_binop (PLUS_EXPR, *step, this_step); *initial_offset = fold (build2 (PLUS_EXPR, TREE_TYPE (*initial_offset), *initial_offset, this_offset)); *************** vect_create_addr_base_for_vector_ref (tr *** 2017,2023 **** tree base_offset = unshare_expr (STMT_VINFO_VECT_INIT_OFFSET (stmt_info)); if (TREE_CODE (TREE_TYPE (data_ref_base)) != POINTER_TYPE) ! /* Add '&' to ref_base, if it is not a pointer. */ data_ref_base = build_fold_addr_expr (data_ref_base); else { --- 2041,2049 ---- tree base_offset = unshare_expr (STMT_VINFO_VECT_INIT_OFFSET (stmt_info)); if (TREE_CODE (TREE_TYPE (data_ref_base)) != POINTER_TYPE) ! /* After the analysis stage, we expect to get here only with RECORD_TYPE ! and ARRAY_TYPE. */ ! /* Add '&' to ref_base. */ data_ref_base = build_fold_addr_expr (data_ref_base); else { *************** vect_create_data_ref_ptr (tree stmt, blo *** 2287,2294 **** type = lang_hooks.types.type_for_size (tree_low_cst (size, 1), 1); ptr_update = create_tmp_var (type, "update"); add_referenced_tmp_var (ptr_update); ! vectype_size = build_int_cst (integer_type_node, ! GET_MODE_SIZE (TYPE_MODE (vectype))); vec_stmt = build2 (MULT_EXPR, integer_type_node, idx, vectype_size); vec_stmt = build2 (MODIFY_EXPR, void_type_node, tmp, vec_stmt); new_temp = make_ssa_name (tmp, vec_stmt); --- 2313,2319 ---- type = lang_hooks.types.type_for_size (tree_low_cst (size, 1), 1); ptr_update = create_tmp_var (type, "update"); add_referenced_tmp_var (ptr_update); ! vectype_size = TYPE_SIZE_UNIT (vectype); vec_stmt = build2 (MULT_EXPR, integer_type_node, idx, vectype_size); vec_stmt = build2 (MODIFY_EXPR, void_type_node, tmp, vec_stmt); new_temp = make_ssa_name (tmp, vec_stmt); *************** vectorizable_load (tree stmt, block_stmt *** 2911,2921 **** else { int mis = DR_MISALIGNMENT (dr); ! tree tmis = (mis == -1 ? ! integer_zero_node : ! build_int_cst (integer_type_node, mis)); ! tmis = int_const_binop (MULT_EXPR, tmis, ! build_int_cst (integer_type_node, BITS_PER_UNIT), 1); data_ref = build2 (MISALIGNED_INDIRECT_REF, vectype, data_ref, tmis); } new_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, data_ref); --- 2936,2943 ---- else { int mis = DR_MISALIGNMENT (dr); ! tree tmis = (mis == -1 ? size_zero_node : size_int (mis)); ! tmis = size_binop (MULT_EXPR, tmis, size_int(BITS_PER_UNIT)); data_ref = build2 (MISALIGNED_INDIRECT_REF, vectype, data_ref, tmis); } new_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, data_ref); *************** vect_gen_niters_for_prolog_loop (loop_ve *** 3567,3573 **** /* If the loop bound is known at compile time we already verified that it is greater than vf; since the misalignment ('iters') is at most vf, there's no need to generate the MIN_EXPR in this case. */ ! if (!host_integerp (loop_niters, 0)) iters = build2 (MIN_EXPR, niters_type, iters, loop_niters); if (vect_debug_details (NULL)) --- 3589,3595 ---- /* If the loop bound is known at compile time we already verified that it is greater than vf; since the misalignment ('iters') is at most vf, there's no need to generate the MIN_EXPR in this case. */ ! if (TREE_CODE (loop_niters) != INTEGER_CST) iters = build2 (MIN_EXPR, niters_type, iters, loop_niters); if (vect_debug_details (NULL)) *************** vect_compute_data_ref_alignment (struct *** 4599,4611 **** && DECL_ALIGN (base) >= TYPE_ALIGN (vectype))); /* Alignment required, in bytes: */ ! alignment = fold_convert (unsigned_type_node, ! build_int_cst (NULL_TREE, TYPE_ALIGN (vectype)/BITS_PER_UNIT)); /* Modulo alignment. */ ! misalign = int_const_binop (TRUNC_MOD_EXPR, misalign, alignment, 0); ! if (!host_integerp (misalign, 1) || TREE_OVERFLOW (misalign)) { if (vect_debug_details (NULL)) fprintf (dump_file, "unexpected misalign value"); return false; --- 4621,4633 ---- && DECL_ALIGN (base) >= TYPE_ALIGN (vectype))); /* Alignment required, in bytes: */ ! alignment = size_int (TYPE_ALIGN (vectype)/BITS_PER_UNIT); /* Modulo alignment. */ ! misalign = size_binop (TRUNC_MOD_EXPR, misalign, alignment); ! if (tree_int_cst_sgn (misalign) < 0) { + /* Negative misalignment value. */ if (vect_debug_details (NULL)) fprintf (dump_file, "unexpected misalign value"); return false; *************** vect_analyze_data_ref_access (struct dat *** 4919,4930 **** stmt_vec_info stmt_info = vinfo_for_stmt (stmt); tree step = STMT_VINFO_VECT_STEP (stmt_info); tree scalar_type = TREE_TYPE (DR_REF (dr)); - tree type_size = build_int_cst (NULL_TREE, GET_MODE_SIZE (TYPE_MODE (scalar_type))); ! if (!step || !simple_cst_equal (type_size, step)) { if (vect_debug_details (NULL)) ! fprintf (dump_file, "not consecutive access"); return false; } return true; --- 4941,4951 ---- stmt_vec_info stmt_info = vinfo_for_stmt (stmt); tree step = STMT_VINFO_VECT_STEP (stmt_info); tree scalar_type = TREE_TYPE (DR_REF (dr)); ! if (!step || tree_int_cst_compare (step, TYPE_SIZE_UNIT (scalar_type))) { if (vect_debug_details (NULL)) ! fprintf (dump_file, "not consecutive access"); return false; } return true; *************** vect_analyze_pointer_ref_access (tree me *** 4996,5004 **** struct loop *loop = STMT_VINFO_LOOP (stmt_info); tree access_fn = analyze_scalar_evolution (loop, TREE_OPERAND (memref, 0)); tree init, step; - int step_val; tree reftype, innertype; - enum machine_mode innermode; tree indx_access_fn; int loopnum = loop->num; struct data_reference *dr; --- 5017,5023 ---- *************** vect_analyze_pointer_ref_access (tree me *** 5025,5031 **** STRIP_NOPS (init); ! if (!host_integerp (step,0)) { if (vect_debug_stats (loop) || vect_debug_details (loop)) fprintf (dump_file, --- 5044,5050 ---- STRIP_NOPS (init); ! if (TREE_CODE (step) != INTEGER_CST) { if (vect_debug_stats (loop) || vect_debug_details (loop)) fprintf (dump_file, *************** vect_analyze_pointer_ref_access (tree me *** 5033,5040 **** return NULL; } - step_val = TREE_INT_CST_LOW (step); - reftype = TREE_TYPE (TREE_OPERAND (memref, 0)); if (TREE_CODE (reftype) != POINTER_TYPE) { --- 5052,5057 ---- *************** vect_analyze_pointer_ref_access (tree me *** 5052,5059 **** } innertype = TREE_TYPE (reftype); ! innermode = TYPE_MODE (innertype); ! if (GET_MODE_SIZE (innermode) != step_val) { /* FORNOW: support only consecutive access */ if (vect_debug_stats (loop) || vect_debug_details (loop)) --- 5069,5075 ---- } innertype = TREE_TYPE (reftype); ! if (tree_int_cst_compare (TYPE_SIZE_UNIT (innertype), step)) { /* FORNOW: support only consecutive access */ if (vect_debug_stats (loop) || vect_debug_details (loop)) *************** vect_analyze_pointer_ref_access (tree me *** 5061,5072 **** return NULL; } ! STMT_VINFO_VECT_STEP (stmt_info) = build_int_cst (NULL_TREE, step_val); if (TREE_CODE (init) == PLUS_EXPR || TREE_CODE (init) == MINUS_EXPR) STMT_VINFO_VECT_INIT_OFFSET (stmt_info) = ! fold (build2 (TREE_CODE (init), TREE_TYPE (TREE_OPERAND (init, 1)), ! size_zero_node, TREE_OPERAND (init, 1))); else STMT_VINFO_VECT_INIT_OFFSET (stmt_info) = size_zero_node; --- 5077,5088 ---- return NULL; } ! STMT_VINFO_VECT_STEP (stmt_info) = fold_convert (sizetype, step); if (TREE_CODE (init) == PLUS_EXPR || TREE_CODE (init) == MINUS_EXPR) STMT_VINFO_VECT_INIT_OFFSET (stmt_info) = ! fold (size_binop (TREE_CODE (init), size_zero_node, ! fold_convert (sizetype, TREE_OPERAND (init, 1)))); else STMT_VINFO_VECT_INIT_OFFSET (stmt_info) = size_zero_node; *************** vect_get_memtag_and_dr (tree memref, tre *** 5251,5257 **** if (step && STMT_VINFO_VECT_STEP (stmt_info)) STMT_VINFO_VECT_STEP (stmt_info) = ! int_const_binop (PLUS_EXPR, step, STMT_VINFO_VECT_STEP (stmt_info), 1); else STMT_VINFO_VECT_STEP (stmt_info) = step; --- 5267,5273 ---- if (step && STMT_VINFO_VECT_STEP (stmt_info)) STMT_VINFO_VECT_STEP (stmt_info) = ! size_binop (PLUS_EXPR, step, STMT_VINFO_VECT_STEP (stmt_info)); else STMT_VINFO_VECT_STEP (stmt_info) = step;