aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-02 18:25:57 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-02 18:25:57 +0000
commit4aae3cb3559802faee3b5cb58d9315dcc5000bc8 (patch)
tree1283f373029f83a2ce2f95fa81a4d7ca81e6826a
parent3ea109a3479cdbbe8a47bf60b2d2d69072a1d51b (diff)
downloadgcc-4aae3cb3559802faee3b5cb58d9315dcc5000bc8.zip
gcc-4aae3cb3559802faee3b5cb58d9315dcc5000bc8.tar.gz
gcc-4aae3cb3559802faee3b5cb58d9315dcc5000bc8.tar.bz2
Pass vec_perm_indices by reference
This patch makes functions take vec_perm_indices by reference rather than value, since a later patch will turn vec_perm_indices into a class that would be more expensive to copy. 2018-01-02 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *. * optabs-query.c (can_vec_perm_p): Likewise. * fold-const.c (fold_vec_perm): Take a const vec_perm_indices & instead of vec_perm_indices. * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise, (vect_gen_perm_mask_checked): Likewise, * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise, (vect_gen_perm_mask_checked): Likewise, From-SVN: r256090
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/fold-const.c2
-rw-r--r--gcc/optabs-query.c2
-rw-r--r--gcc/optabs-query.h2
-rw-r--r--gcc/tree-vect-stmts.c4
-rw-r--r--gcc/tree-vectorizer.h4
6 files changed, 18 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 60bbfbf..be819e2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
+ * optabs-query.h (can_vec_perm_p): Take a const vec_perm_indices *.
+ * optabs-query.c (can_vec_perm_p): Likewise.
+ * fold-const.c (fold_vec_perm): Take a const vec_perm_indices &
+ instead of vec_perm_indices.
+ * tree-vectorizer.h (vect_gen_perm_mask_any): Likewise,
+ (vect_gen_perm_mask_checked): Likewise,
+ * tree-vect-stmts.c (vect_gen_perm_mask_any): Likewise,
+ (vect_gen_perm_mask_checked): Likewise,
+
+2018-01-02 Richard Sandiford <richard.sandiford@linaro.org>
+
* optabs-query.h (qimode_for_vec_perm): Declare.
* optabs-query.c (can_vec_perm_p): Split out qimode search to...
(qimode_for_vec_perm): ...this new function.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index e776108..224c085 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -8923,7 +8923,7 @@ vec_cst_ctor_to_array (tree arg, unsigned int nelts, tree *elts)
NULL_TREE otherwise. */
static tree
-fold_vec_perm (tree type, tree arg0, tree arg1, vec_perm_indices sel)
+fold_vec_perm (tree type, tree arg0, tree arg1, const vec_perm_indices &sel)
{
unsigned int i;
bool need_ctor = false;
diff --git a/gcc/optabs-query.c b/gcc/optabs-query.c
index 02a583f..b8e7e31 100644
--- a/gcc/optabs-query.c
+++ b/gcc/optabs-query.c
@@ -369,7 +369,7 @@ qimode_for_vec_perm (machine_mode mode)
zeroes; this case is not dealt with here. */
bool
-can_vec_perm_p (machine_mode mode, bool variable, vec_perm_indices *sel)
+can_vec_perm_p (machine_mode mode, bool variable, const vec_perm_indices *sel)
{
machine_mode qimode;
diff --git a/gcc/optabs-query.h b/gcc/optabs-query.h
index ce0c401..3924296 100644
--- a/gcc/optabs-query.h
+++ b/gcc/optabs-query.h
@@ -175,7 +175,7 @@ enum insn_code can_float_p (machine_mode, machine_mode, int);
enum insn_code can_fix_p (machine_mode, machine_mode, int, bool *);
bool can_conditionally_move_p (machine_mode mode);
opt_machine_mode qimode_for_vec_perm (machine_mode);
-bool can_vec_perm_p (machine_mode, bool, vec_perm_indices *);
+bool can_vec_perm_p (machine_mode, bool, const vec_perm_indices *);
/* Find a widening optab even if it doesn't widen as much as we want. */
#define find_widening_optab_handler(A, B, C) \
find_widening_optab_handler_and_mode (A, B, C, NULL)
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 0c343d4..b0df11b 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -6523,7 +6523,7 @@ vectorizable_store (gimple *stmt, gimple_stmt_iterator *gsi, gimple **vec_stmt,
vect_gen_perm_mask_checked. */
tree
-vect_gen_perm_mask_any (tree vectype, vec_perm_indices sel)
+vect_gen_perm_mask_any (tree vectype, const vec_perm_indices &sel)
{
tree mask_elt_type, mask_type;
@@ -6544,7 +6544,7 @@ vect_gen_perm_mask_any (tree vectype, vec_perm_indices sel)
i.e. that the target supports the pattern _for arbitrary input vectors_. */
tree
-vect_gen_perm_mask_checked (tree vectype, vec_perm_indices sel)
+vect_gen_perm_mask_checked (tree vectype, const vec_perm_indices &sel)
{
gcc_assert (can_vec_perm_p (TYPE_MODE (vectype), false, &sel));
return vect_gen_perm_mask_any (vectype, sel);
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 8291a71..6b75afc 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -1212,8 +1212,8 @@ extern void vect_get_load_cost (struct data_reference *, int, bool,
extern void vect_get_store_cost (struct data_reference *, int,
unsigned int *, stmt_vector_for_cost *);
extern bool vect_supportable_shift (enum tree_code, tree);
-extern tree vect_gen_perm_mask_any (tree, vec_perm_indices);
-extern tree vect_gen_perm_mask_checked (tree, vec_perm_indices);
+extern tree vect_gen_perm_mask_any (tree, const vec_perm_indices &);
+extern tree vect_gen_perm_mask_checked (tree, const vec_perm_indices &);
extern void optimize_mask_stores (struct loop*);
/* In tree-vect-data-refs.c. */