aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-10-14 08:32:25 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-10-14 08:32:25 +0000
commitddf56386c14bc6db5e6d5eb41e58da8253b6102a (patch)
tree61b148260abf3b7df84bf93f6cb3b0ccc38fe1e9 /gcc
parentac8a1965363534d831c6b784bd69aa18b846402a (diff)
downloadgcc-ddf56386c14bc6db5e6d5eb41e58da8253b6102a.zip
gcc-ddf56386c14bc6db5e6d5eb41e58da8253b6102a.tar.gz
gcc-ddf56386c14bc6db5e6d5eb41e58da8253b6102a.tar.bz2
tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Reset info at start.
2015-10-14 Richard Biener <rguenther@suse.de> * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Reset info at start. (vect_analyze_group_access_1): Add debug print. * tree-vect-loop.c (vect_get_single_scalar_iteration_cost): Rename ... (vect_compute_single_scalar_iteration_cost): ... to this. (vect_analyze_loop_2): Adjust. * tree-vect-slp.c (struct _slp_oprnd_info): Move from ... * tree-vectorizer.h: ... here. (add_stmt_info_to_vec): Remove. * tree-vect-stmts.c (record_stmt_cost): Inline add_stmt_info_to_vec. From-SVN: r228806
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/tree-vect-data-refs.c8
-rw-r--r--gcc/tree-vect-loop.c4
-rw-r--r--gcc/tree-vect-slp.c17
-rw-r--r--gcc/tree-vect-stmts.c8
-rw-r--r--gcc/tree-vectorizer.h29
6 files changed, 44 insertions, 35 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0e9ce3f..2dcb640 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2015-10-14 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
+ Reset info at start.
+ (vect_analyze_group_access_1): Add debug print.
+ * tree-vect-loop.c (vect_get_single_scalar_iteration_cost): Rename ...
+ (vect_compute_single_scalar_iteration_cost): ... to this.
+ (vect_analyze_loop_2): Adjust.
+ * tree-vect-slp.c (struct _slp_oprnd_info): Move from ...
+ * tree-vectorizer.h: ... here.
+ (add_stmt_info_to_vec): Remove.
+ * tree-vect-stmts.c (record_stmt_cost): Inline add_stmt_info_to_vec.
+
2015-10-14 Dominik Vogt <vogt@linux.vnet.ibm.com>
* targhooks.c (default_target_option_pragma_parse): Do not warn if
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 8a4d489..c3db22f 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -1352,6 +1352,10 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
dump_printf_loc (MSG_NOTE, vect_location,
"=== vect_enhance_data_refs_alignment ===\n");
+ /* Reset data so we can safely be called multiple times. */
+ LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo).truncate (0);
+ LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo) = 0;
+
/* While cost model enhancements are expected in the future, the high level
view of the code at this time is as follows:
@@ -2151,6 +2155,10 @@ vect_analyze_group_access_1 (struct data_reference *dr)
return false;
}
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "Two or more load stmts share the same dr.\n");
+
/* For load use the same data-ref load. */
GROUP_SAME_DR_STMT (vinfo_for_stmt (next)) = prev;
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 6840535..e74fe9a 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -1043,7 +1043,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts)
/* Calculate the cost of one scalar iteration of the loop. */
static void
-vect_get_single_scalar_iteration_cost (loop_vec_info loop_vinfo)
+vect_compute_single_scalar_iteration_cost (loop_vec_info loop_vinfo)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
@@ -1739,7 +1739,7 @@ vect_analyze_loop_2 (loop_vec_info loop_vinfo)
}
/* Compute the scalar iteration cost. */
- vect_get_single_scalar_iteration_cost (loop_vinfo);
+ vect_compute_single_scalar_iteration_cost (loop_vinfo);
/* This pass will decide on using loop versioning and/or loop peeling in
order to enhance the alignment of data references in the loop. */
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 7e6ac52..3cb06c5 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -135,6 +135,23 @@ vect_create_new_slp_node (vec<gimple *> scalar_stmts)
}
+/* This structure is used in creation of an SLP tree. Each instance
+ corresponds to the same operand in a group of scalar stmts in an SLP
+ node. */
+typedef struct _slp_oprnd_info
+{
+ /* Def-stmts for the operands. */
+ vec<gimple *> def_stmts;
+ /* Information about the first statement, its vector def-type, type, the
+ operand itself in case it's constant, and an indication if it's a pattern
+ stmt. */
+ enum vect_def_type first_dt;
+ tree first_op_type;
+ bool first_pattern;
+ bool second_pattern;
+} *slp_oprnd_info;
+
+
/* Allocate operands info for NOPS operands, and GROUP_SIZE def-stmts for each
operand. */
static vec<slp_oprnd_info>
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index a5e1cb7..337fab0 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -94,12 +94,12 @@ record_stmt_cost (stmt_vector_for_cost *body_cost_vec, int count,
if (body_cost_vec)
{
tree vectype = stmt_info ? stmt_vectype (stmt_info) : NULL_TREE;
- add_stmt_info_to_vec (body_cost_vec, count, kind,
- stmt_info ? STMT_VINFO_STMT (stmt_info) : NULL,
- misalign);
+ stmt_info_for_cost si = { count, kind,
+ stmt_info ? STMT_VINFO_STMT (stmt_info) : NULL,
+ misalign };
+ body_cost_vec->safe_push (si);
return (unsigned)
(builtin_vectorization_cost (kind, vectype, misalign) * count);
-
}
else
return add_stmt_cost (stmt_info->vinfo->target_cost_data,
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index ebe38b7..9450899 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -73,21 +73,8 @@ struct stmt_info_for_cost {
int misalign;
};
-
typedef vec<stmt_info_for_cost> stmt_vector_for_cost;
-static inline void
-add_stmt_info_to_vec (stmt_vector_for_cost *stmt_cost_vec, int count,
- enum vect_cost_for_stmt kind, gimple *stmt, int misalign)
-{
- stmt_info_for_cost si;
- si.count = count;
- si.kind = kind;
- si.stmt = stmt;
- si.misalign = misalign;
- stmt_cost_vec->safe_push (si);
-}
-
/************************************************************************
SLP
************************************************************************/
@@ -145,22 +132,6 @@ typedef struct _slp_instance {
#define SLP_TREE_LOAD_PERMUTATION(S) (S)->load_permutation
#define SLP_TREE_TWO_OPERATORS(S) (S)->two_operators
-/* This structure is used in creation of an SLP tree. Each instance
- corresponds to the same operand in a group of scalar stmts in an SLP
- node. */
-typedef struct _slp_oprnd_info
-{
- /* Def-stmts for the operands. */
- vec<gimple *> def_stmts;
- /* Information about the first statement, its vector def-type, type, the
- operand itself in case it's constant, and an indication if it's a pattern
- stmt. */
- enum vect_def_type first_dt;
- tree first_op_type;
- bool first_pattern;
- bool second_pattern;
-} *slp_oprnd_info;
-
/* This struct is used to store the information of a data reference,