diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-04 15:04:15 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-04 15:04:15 +0000 |
commit | 6198d968dbe721ee9fc231ad54e5d203c9846e5c (patch) | |
tree | 1745a46aaf5a6b03f3fbcde7185c2656be7d45bc /gcc/tree-data-ref.h | |
parent | 79a1581a1ff07bcb03955ffeda2ae349be4d2ef2 (diff) | |
download | gcc-6198d968dbe721ee9fc231ad54e5d203c9846e5c.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188186 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-data-ref.h')
-rw-r--r-- | gcc/tree-data-ref.h | 28 |
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 */ |