diff options
Diffstat (limited to 'gcc/tree-vect-analyze.c')
-rw-r--r-- | gcc/tree-vect-analyze.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index dd9342a8136..97ad2314b65 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -71,7 +71,8 @@ static bool vect_base_addr_differ_p (struct data_reference *, struct data_reference *drb, bool *); static tree vect_object_analysis (tree, tree, bool, tree, struct data_reference **, tree *, tree *, - tree *, bool *, tree *, subvar_t *); + tree *, bool *, tree *, struct ptr_info_def **, + subvar_t *); static tree vect_address_analysis (tree, tree, bool, tree, struct data_reference *, tree *, tree *, tree *, bool *); @@ -1183,8 +1184,6 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) } DR_MISALIGNMENT (dr0) = 0; - if (vect_print_dump_info (REPORT_ALIGNMENT, LOOP_LOC (loop_vinfo))) - fprintf (vect_dump, "Alignment of access forced using peeling."); } } @@ -1260,6 +1259,9 @@ vect_analyze_data_refs_alignment (loop_vec_info loop_vinfo) && (vect_print_dump_info (REPORT_ALIGNMENT, LOOP_LOC (loop_vinfo)))) fprintf (vect_dump, "Vectorizing an unaligned access."); } + if (LOOP_VINFO_UNALIGNED_DR (loop_vinfo) + && vect_print_dump_info (REPORT_ALIGNMENT, LOOP_LOC (loop_vinfo))) + fprintf (vect_dump, "Alignment of access forced using peeling."); return true; } @@ -1475,6 +1477,7 @@ vect_address_analysis (tree expr, tree stmt, bool is_read, tree vectype, tree oprnd0, oprnd1, base_address, offset_expr, base_addr0, base_addr1; tree address_offset = ssize_int (0), address_misalign = ssize_int (0); tree dummy; + struct ptr_info_def *dummy1; subvar_t dummy2; switch (TREE_CODE (expr)) @@ -1528,7 +1531,7 @@ vect_address_analysis (tree expr, tree stmt, bool is_read, tree vectype, base_address = vect_object_analysis (TREE_OPERAND (expr, 0), stmt, is_read, vectype, &dr, offset, misalign, step, base_aligned, - &dummy, &dummy2); + &dummy, &dummy1, &dummy2); return base_address; case SSA_NAME: @@ -1607,6 +1610,7 @@ vect_address_analysis (tree expr, tree stmt, bool is_read, tree vectype, STEP - evolution of the DR_REF in the loop BASE_ALIGNED - indicates if BASE is aligned MEMTAG - memory tag for aliasing purposes + PTR_INFO - NULL or points-to aliasing info from a pointer SSA_NAME SUBVAR - Sub-variables of the variable If something unexpected is encountered (an unsupported form of data-ref), @@ -1617,7 +1621,7 @@ vect_object_analysis (tree memref, tree stmt, bool is_read, tree vectype, struct data_reference **dr, tree *offset, tree *misalign, tree *step, bool *base_aligned, tree *memtag, - subvar_t *subvars) + struct ptr_info_def **ptr_info, subvar_t *subvars) { tree base = NULL_TREE, base_address = NULL_TREE; tree object_offset = ssize_int (0), object_misalign = ssize_int (0); @@ -1634,6 +1638,8 @@ vect_object_analysis (tree memref, tree stmt, bool is_read, struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo); struct data_reference *ptr_dr = NULL; tree access_fn, evolution_part, address_to_analyze; + + *ptr_info = NULL; /* Part 1: */ /* Case 1. handled_component_p refs. */ @@ -1721,9 +1727,13 @@ vect_object_analysis (tree memref, tree stmt, bool is_read, /* Part 1: Case 3. INDIRECT_REFs. */ else if (TREE_CODE (memref) == INDIRECT_REF) - { + { + tree ptr_ref = TREE_OPERAND (memref, 0); + if (TREE_CODE (ptr_ref) == SSA_NAME) + *ptr_info = SSA_NAME_PTR_INFO (ptr_ref); + /* 3.1 get the access function. */ - access_fn = analyze_scalar_evolution (loop, TREE_OPERAND (memref, 0)); + access_fn = analyze_scalar_evolution (loop, ptr_ref); if (!access_fn) { if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS, @@ -1848,7 +1858,7 @@ vect_object_analysis (tree memref, tree stmt, bool is_read, Call get_inner_reference for refs handled in this function. Call vect_addr_analysis(addr) to analyze pointer type expressions. Set ref_stmt.base, ref_stmt.initial_offset, ref_stmt.alignment, - ref_stmt.memtag and ref_stmt.step accordingly. + ref_stmt.memtag, ref_stmt.ptr_info and ref_stmt.step accordingly. 2- vect_analyze_dependences(): apply dependence testing using ref_stmt.DR 3- vect_analyze_drs_alignment(): check that ref_stmt.alignment is ok. 4- vect_analyze_drs_access(): check that ref_stmt.step is ok. @@ -1886,6 +1896,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo) tree memref = NULL; tree scalar_type, vectype; tree base, offset, misalign, step, tag; + struct ptr_info_def *ptr_info; bool base_aligned; subvar_t subvars = NULL; @@ -1951,7 +1962,8 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo) dr = NULL; base = vect_object_analysis (memref, stmt, is_read, vectype, &dr, &offset, &misalign, &step, - &base_aligned, &tag, &subvars); + &base_aligned, &tag, &ptr_info, + &subvars); if (!base) { if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS, @@ -1968,6 +1980,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo) STMT_VINFO_VECT_MISALIGNMENT (stmt_info) = misalign; STMT_VINFO_VECT_BASE_ALIGNED_P (stmt_info) = base_aligned; STMT_VINFO_MEMTAG (stmt_info) = tag; + STMT_VINFO_PTR_INFO (stmt_info) = ptr_info; STMT_VINFO_SUBVARS (stmt_info) = subvars; STMT_VINFO_VECTYPE (stmt_info) = vectype; VARRAY_PUSH_GENERIC_PTR (*datarefs, dr); |