diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-29 16:38:34 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-29 16:38:34 +0000 |
commit | 590a32b63101952def48695fa33d5ea8c0c90e96 (patch) | |
tree | a4c20de8db389d460e829d3993191ae46902f345 /gcc/tree-vect-data-refs.c | |
parent | 307f7fdab3d257c2d86a68133d5bba4c9e2af961 (diff) | |
download | gcc-590a32b63101952def48695fa33d5ea8c0c90e96.tar.gz |
Improve vectorization diagnostic: loop contains function calls.
2010-03-29 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43436
* tree-vect-data-refs.c (vect_analyze_data_refs): When
compute_data_dependences_for_loop returns false, early exit
and output an extra diagnostic for the failed data reference
analysis.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157800 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r-- | gcc/tree-vect-data-refs.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 37ae9b5e3bf..aa7d89c957f 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1860,6 +1860,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) VEC (data_reference_p, heap) *datarefs; struct data_reference *dr; tree scalar_type; + bool res; if (vect_print_dump_info (REPORT_DETAILS)) fprintf (vect_dump, "=== vect_analyze_data_refs ===\n"); @@ -1867,17 +1868,34 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) if (loop_vinfo) { loop = LOOP_VINFO_LOOP (loop_vinfo); - compute_data_dependences_for_loop (loop, true, - &LOOP_VINFO_DATAREFS (loop_vinfo), - &LOOP_VINFO_DDRS (loop_vinfo)); + res = compute_data_dependences_for_loop + (loop, true, &LOOP_VINFO_DATAREFS (loop_vinfo), + &LOOP_VINFO_DDRS (loop_vinfo)); + + if (!res) + { + if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS)) + fprintf (vect_dump, "not vectorized: loop contains function calls" + " or data references that cannot be analyzed"); + return false; + } + datarefs = LOOP_VINFO_DATAREFS (loop_vinfo); } else { bb = BB_VINFO_BB (bb_vinfo); - compute_data_dependences_for_bb (bb, true, - &BB_VINFO_DATAREFS (bb_vinfo), - &BB_VINFO_DDRS (bb_vinfo)); + res = compute_data_dependences_for_bb (bb, true, + &BB_VINFO_DATAREFS (bb_vinfo), + &BB_VINFO_DDRS (bb_vinfo)); + if (!res) + { + if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS)) + fprintf (vect_dump, "not vectorized: basic block contains function" + " calls or data references that cannot be analyzed"); + return false; + } + datarefs = BB_VINFO_DATAREFS (bb_vinfo); } |