diff options
author | Richard Biener <rguenther@suse.de> | 2020-07-08 16:37:55 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-07-09 13:17:07 +0200 |
commit | a1e25d0008791118dd58eaddff5f4c3691f8750e (patch) | |
tree | 43f3ef21028a8e22ca748259ff67e9ded6f5bb15 /gcc/tree-vect-data-refs.c | |
parent | dd21b03900085c4d60bf03207ad28bcbfbc86a4b (diff) | |
download | gcc-a1e25d0008791118dd58eaddff5f4c3691f8750e.zip gcc-a1e25d0008791118dd58eaddff5f4c3691f8750e.tar.gz gcc-a1e25d0008791118dd58eaddff5f4c3691f8750e.tar.bz2 |
remove premature vect_verify_datarefs_alignment
This followup removes vect_verify_datarefs_alignment and its
premature cancellation of vectorization leaving the actual
decision whether alignment is supported to the functions
deciding whether we can vectorize a load or store.
2020-07-08 Richard Biener <rguenther@suse.de>
* tree-vectorizer.h (vect_verify_datarefs_alignment): Remove.
(vect_slp_analyze_and_verify_instance_alignment): Rename to ...
(vect_slp_analyze_instance_alignment): ... this.
* tree-vect-data-refs.c (verify_data_ref_alignment): Remove.
(vect_verify_datarefs_alignment): Likewise.
(vect_enhance_data_refs_alignment): Do not call
vect_verify_datarefs_alignment.
(vect_slp_analyze_node_alignment): Rename from
vect_slp_analyze_and_verify_node_alignment and do not
call verify_data_ref_alignment.
(vect_slp_analyze_instance_alignment): Rename from
vect_slp_analyze_and_verify_instance_alignment.
* tree-vect-stmts.c (vectorizable_store): Dump when
we vectorize an unaligned access.
(vectorizable_load): Likewise.
* tree-vect-loop.c (vect_analyze_loop_2): Do not call
vect_verify_datarefs_alignment.
* tree-vect-slp.c (vect_slp_analyze_bb_1): Adjust.
* gcc.dg/vect/bb-slp-10.c: Adjust.
* gcc.dg/vect/slp-45.c: Likewise.
* gcc.dg/vect/vect-109.c: Likewise.
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r-- | gcc/tree-vect-data-refs.c | 88 |
1 files changed, 9 insertions, 79 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 2b4421b..e35a215 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1214,56 +1214,6 @@ vect_relevant_for_alignment_p (dr_vec_info *dr_info) return true; } -/* Function verify_data_ref_alignment - - Return TRUE if DR_INFO can be handled with respect to alignment. */ - -static opt_result -verify_data_ref_alignment (vec_info *vinfo, dr_vec_info *dr_info) -{ - enum dr_alignment_support supportable_dr_alignment - = vect_supportable_dr_alignment (vinfo, dr_info, false); - if (!supportable_dr_alignment) - return opt_result::failure_at - (dr_info->stmt->stmt, - DR_IS_READ (dr_info->dr) - ? "not vectorized: unsupported unaligned load: %T\n" - : "not vectorized: unsupported unaligned store: %T\n", - DR_REF (dr_info->dr)); - - if (supportable_dr_alignment != dr_aligned && dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, - "Vectorizing an unaligned access.\n"); - - return opt_result::success (); -} - -/* Function vect_verify_datarefs_alignment - - Return TRUE if all data references in the loop can be - handled with respect to alignment. */ - -opt_result -vect_verify_datarefs_alignment (loop_vec_info loop_vinfo) -{ - vec<data_reference_p> datarefs = LOOP_VINFO_DATAREFS (loop_vinfo); - struct data_reference *dr; - unsigned int i; - - FOR_EACH_VEC_ELT (datarefs, i, dr) - { - dr_vec_info *dr_info = loop_vinfo->lookup_dr (dr); - if (!vect_relevant_for_alignment_p (dr_info)) - continue; - - opt_result res = verify_data_ref_alignment (loop_vinfo, dr_info); - if (!res) - return res; - } - - return opt_result::success (); -} - /* Given an memory reference EXP return whether its alignment is less than its size. */ @@ -2091,13 +2041,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) /* Check if all datarefs are supportable and log. */ if (do_peeling && known_alignment_for_access_p (dr0_info) && npeel == 0) - { - opt_result stat = vect_verify_datarefs_alignment (loop_vinfo); - if (!stat) - do_peeling = false; - else - return stat; - } + return opt_result::success (); /* Cost model #1 - honor --param vect-max-peeling-for-alignment. */ if (do_peeling) @@ -2186,9 +2130,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) /* The inside-loop cost will be accounted for in vectorizable_load and vectorizable_store correctly with adjusted alignments. Drop the body_cst_vec on the floor here. */ - opt_result stat = vect_verify_datarefs_alignment (loop_vinfo); - gcc_assert (stat); - return stat; + return opt_result::success (); } } @@ -2318,16 +2260,13 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) /* Peeling and versioning can't be done together at this time. */ gcc_assert (! (do_peeling && do_versioning)); - opt_result stat = vect_verify_datarefs_alignment (loop_vinfo); - gcc_assert (stat); - return stat; + return opt_result::success (); } /* This point is reached if neither peeling nor versioning is being done. */ gcc_assert (! (do_peeling || do_versioning)); - opt_result stat = vect_verify_datarefs_alignment (loop_vinfo); - return stat; + return opt_result::success (); } @@ -2431,7 +2370,7 @@ vect_analyze_data_refs_alignment (loop_vec_info loop_vinfo) /* Analyze alignment of DRs of stmts in NODE. */ static bool -vect_slp_analyze_and_verify_node_alignment (vec_info *vinfo, slp_tree node) +vect_slp_analyze_node_alignment (vec_info *vinfo, slp_tree node) { /* We vectorize from the first scalar stmt in the node unless the node is permuted in which case we start from the first @@ -2457,15 +2396,6 @@ vect_slp_analyze_and_verify_node_alignment (vec_info *vinfo, slp_tree node) vect_compute_data_ref_alignment (vinfo, first_dr_info); } - if (! verify_data_ref_alignment (vinfo, dr_info)) - { - if (dump_enabled_p ()) - dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, - "not vectorized: bad data alignment in basic " - "block.\n"); - return false; - } - return true; } @@ -2475,20 +2405,20 @@ vect_slp_analyze_and_verify_node_alignment (vec_info *vinfo, slp_tree node) Return FALSE if a data reference is found that cannot be vectorized. */ bool -vect_slp_analyze_and_verify_instance_alignment (vec_info *vinfo, +vect_slp_analyze_instance_alignment (vec_info *vinfo, slp_instance instance) { - DUMP_VECT_SCOPE ("vect_slp_analyze_and_verify_instance_alignment"); + DUMP_VECT_SCOPE ("vect_slp_analyze_instance_alignment"); slp_tree node; unsigned i; FOR_EACH_VEC_ELT (SLP_INSTANCE_LOADS (instance), i, node) - if (! vect_slp_analyze_and_verify_node_alignment (vinfo, node)) + if (! vect_slp_analyze_node_alignment (vinfo, node)) return false; node = SLP_INSTANCE_TREE (instance); if (STMT_VINFO_DATA_REF (SLP_TREE_REPRESENTATIVE (node)) - && ! vect_slp_analyze_and_verify_node_alignment + && ! vect_slp_analyze_node_alignment (vinfo, SLP_INSTANCE_TREE (instance))) return false; |