summaryrefslogtreecommitdiff
path: root/gcc/tree-loop-distribution.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-loop-distribution.c')
-rw-r--r--gcc/tree-loop-distribution.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 52db3c94bd9..fbb891fdedf 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -927,6 +927,9 @@ const_with_all_bytes_same (tree val)
&& CONSTRUCTOR_NELTS (val) == 0))
return 0;
+ if (TREE_CODE (val) == VEC_DUPLICATE_CST)
+ return const_with_all_bytes_same (VEC_DUPLICATE_CST_ELT (val));
+
if (real_zerop (val))
{
/* Only return 0 for +0.0, not for -0.0, which doesn't have
@@ -1510,10 +1513,16 @@ classify_builtin_st (loop_p loop, partition *partition, data_reference_p dr)
if (!compute_access_range (loop, dr, &base, &size))
return;
+ poly_uint64 base_offset;
+ unsigned HOST_WIDE_INT const_base_offset;
+ tree base_base = strip_offset (base, &base_offset);
+ if (!base_offset.is_constant (&const_base_offset))
+ return;
+
struct builtin_info *builtin;
builtin = alloc_builtin (dr, NULL, base, NULL_TREE, size);
- builtin->dst_base_base = strip_offset (builtin->dst_base,
- &builtin->dst_base_offset);
+ builtin->dst_base_base = base_base;
+ builtin->dst_base_offset = const_base_offset;
partition->builtin = builtin;
partition->kind = PKIND_MEMSET;
}
@@ -2321,16 +2330,12 @@ break_alias_scc_partitions (struct graph *rdg,
static tree
data_ref_segment_size (struct data_reference *dr, tree niters)
{
- tree segment_length;
-
- if (integer_zerop (DR_STEP (dr)))
- segment_length = TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr)));
- else
- segment_length = size_binop (MULT_EXPR,
- fold_convert (sizetype, DR_STEP (dr)),
- fold_convert (sizetype, niters));
-
- return segment_length;
+ niters = size_binop (MINUS_EXPR,
+ fold_convert (sizetype, niters),
+ size_one_node);
+ return size_binop (MULT_EXPR,
+ fold_convert (sizetype, DR_STEP (dr)),
+ fold_convert (sizetype, niters));
}
/* Return true if LOOP's latch is dominated by statement for data reference
@@ -2385,9 +2390,16 @@ compute_alias_check_pairs (struct loop *loop, vec<ddr_p> *alias_ddrs,
else
seg_length_b = data_ref_segment_size (dr_b, niters);
+ unsigned HOST_WIDE_INT access_size_a
+ = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr_a))));
+ unsigned HOST_WIDE_INT access_size_b
+ = tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dr_b))));
+ unsigned int align_a = TYPE_ALIGN_UNIT (TREE_TYPE (DR_REF (dr_a)));
+ unsigned int align_b = TYPE_ALIGN_UNIT (TREE_TYPE (DR_REF (dr_b)));
+
dr_with_seg_len_pair_t dr_with_seg_len_pair
- (dr_with_seg_len (dr_a, seg_length_a),
- dr_with_seg_len (dr_b, seg_length_b));
+ (dr_with_seg_len (dr_a, seg_length_a, access_size_a, align_a),
+ dr_with_seg_len (dr_b, seg_length_b, access_size_b, align_b));
/* Canonicalize pairs by sorting the two DR members. */
if (comp_res > 0)