summaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.h
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-06-04 15:04:15 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-06-04 15:04:15 +0000
commitbe6b029b8cdf4c17a9f040332b8345f0fa13ed43 (patch)
tree1745a46aaf5a6b03f3fbcde7185c2656be7d45bc /gcc/tree-data-ref.h
parent36829666e2790ceef58549aa6b3c5dbb357b0af9 (diff)
downloadgcc-be6b029b8cdf4c17a9f040332b8345f0fa13ed43.tar.gz
tree-data-ref.c (stores_from_loop): Remove.
2012-06-04 Richard Guenther <rguenther@suse.de> * tree-data-ref.c (stores_from_loop): Remove. (stmt_with_adjacent_zero_store_dr_p): Likewise. (stores_zero_from_loop): Likewise. * tree-data-ref.h (stores_from_loop, stores_zero_from_loop, stmt_with_adjacent_zero_store_dr_p, stride_of_unit_type_p): Remove. (adjacent_store_dr_p): New function. * tree-loop-distribution.c (generate_memset_builtin): Pass the RDG, use the already available data-reference. (generate_code_for_partition): Pass down RDG. (classify_partition): Inline parts of the former stmt_with_adjacent_zero_store_dr_p here and use adjacent_store_dr_p. (ldist_gen): Remember if there was any detected builtin and do less work if not and flag_tree_loop_distribution is not set. (tree_loop_distribution): Inline and fuse stores_from_loop and stores_zero_from_loop here. From-SVN: r188186
Diffstat (limited to 'gcc/tree-data-ref.h')
-rw-r--r--gcc/tree-data-ref.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index 2edddc03d44..853dd813411 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -609,21 +609,29 @@ index_in_loop_nest (int var, VEC (loop_p, heap) *loop_nest)
return var_index;
}
-void stores_from_loop (struct loop *, VEC (gimple, heap) **);
-void stores_zero_from_loop (struct loop *, VEC (gimple, heap) **);
bool rdg_defs_used_in_other_loops_p (struct graph *, int);
-bool stmt_with_adjacent_zero_store_dr_p (gimple);
-/* Returns true when STRIDE is equal in absolute value to the size of
- the unit type of TYPE. */
+/* Returns true when the data reference DR the form "A[i] = ..."
+ with a stride equal to its unit type size. */
static inline bool
-stride_of_unit_type_p (tree stride, tree type)
+adjacent_store_dr_p (struct data_reference *dr)
{
- return (TREE_CODE (stride) == INTEGER_CST
- && tree_int_cst_equal (fold_unary (ABS_EXPR, TREE_TYPE (stride),
- stride),
- TYPE_SIZE_UNIT (type)));
+ if (!DR_IS_WRITE (dr))
+ return false;
+
+ /* If this is a bitfield store bail out. */
+ if (TREE_CODE (DR_REF (dr)) == COMPONENT_REF
+ && DECL_BIT_FIELD (TREE_OPERAND (DR_REF (dr), 1)))
+ return false;
+
+ if (!DR_STEP (dr)
+ || TREE_CODE (DR_STEP (dr)) != INTEGER_CST)
+ return false;
+
+ return tree_int_cst_equal (fold_unary (ABS_EXPR, TREE_TYPE (DR_STEP (dr)),
+ DR_STEP (dr)),
+ TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr))));
}
/* In tree-data-ref.c */