Commit e054a185 by Richard Sandiford Committed by Richard Sandiford

Rename DR_ALIGNED_TO to DR_OFFSET_ALIGNMENT

This patch renames DR_ALIGNED_TO to DR_OFFSET_ALIGNMENT, to avoid
confusion with the upcoming DR_BASE_ALIGNMENT.  Nothing needed the
value as a tree, and the value is clipped to BIGGEST_ALIGNMENT
(maybe it should be MAX_OFILE_ALIGNMENT?) so we might as well use
an unsigned int instead.

2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-data-ref.h (innermost_loop_behavior): Replace aligned_to
	with offset_alignment.
	(DR_ALIGNED_TO): Delete.
	(DR_OFFSET_ALIGNMENT): New macro.
	* tree-vectorizer.h (STMT_VINFO_DR_ALIGNED_TO): Delete.
	(STMT_VINFO_DR_OFFSET_ALIGNMENT): New macro.
	* tree-data-ref.c (dr_analyze_innermost): Update after above changes.
	(create_data_ref): Likewise.
	* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Likewise.
	(vect_analyze_data_refs): Likewise.
	* tree-if-conv.c (if_convertible_loop_p_1): Use memset before
	creating dummy innermost behavior.

From-SVN: r249914
parent abbe3756
2017-07-03 Richard Sandiford <richard.sandiford@linaro.org> 2017-07-03 Richard Sandiford <richard.sandiford@linaro.org>
* tree-data-ref.h (innermost_loop_behavior): Replace aligned_to
with offset_alignment.
(DR_ALIGNED_TO): Delete.
(DR_OFFSET_ALIGNMENT): New macro.
* tree-vectorizer.h (STMT_VINFO_DR_ALIGNED_TO): Delete.
(STMT_VINFO_DR_OFFSET_ALIGNMENT): New macro.
* tree-data-ref.c (dr_analyze_innermost): Update after above changes.
(create_data_ref): Likewise.
* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Likewise.
(vect_analyze_data_refs): Likewise.
* tree-if-conv.c (if_convertible_loop_p_1): Use memset before
creating dummy innermost behavior.
2017-07-03 Richard Sandiford <richard.sandiford@linaro.org>
* tree-data-ref.h (dr_analyze_innermost): Replace the dr argument * tree-data-ref.h (dr_analyze_innermost): Replace the dr argument
with a "innermost_loop_behavior *" and refeence tree. with a "innermost_loop_behavior *" and refeence tree.
* tree-data-ref.c (dr_analyze_innermost): Likewise. * tree-data-ref.c (dr_analyze_innermost): Likewise.
......
...@@ -869,7 +869,7 @@ dr_analyze_innermost (innermost_loop_behavior *drb, tree ref, ...@@ -869,7 +869,7 @@ dr_analyze_innermost (innermost_loop_behavior *drb, tree ref,
drb->offset = fold_convert (ssizetype, offset_iv.base); drb->offset = fold_convert (ssizetype, offset_iv.base);
drb->init = init; drb->init = init;
drb->step = step; drb->step = step;
drb->aligned_to = size_int (highest_pow2_factor (offset_iv.base)); drb->offset_alignment = highest_pow2_factor (offset_iv.base);
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "success.\n"); fprintf (dump_file, "success.\n");
...@@ -1084,8 +1084,8 @@ create_data_ref (loop_p nest, loop_p loop, tree memref, gimple *stmt, ...@@ -1084,8 +1084,8 @@ create_data_ref (loop_p nest, loop_p loop, tree memref, gimple *stmt,
print_generic_expr (dump_file, DR_INIT (dr), TDF_SLIM); print_generic_expr (dump_file, DR_INIT (dr), TDF_SLIM);
fprintf (dump_file, "\n\tstep: "); fprintf (dump_file, "\n\tstep: ");
print_generic_expr (dump_file, DR_STEP (dr), TDF_SLIM); print_generic_expr (dump_file, DR_STEP (dr), TDF_SLIM);
fprintf (dump_file, "\n\taligned to: "); fprintf (dump_file, "\n\toffset alignment: %d",
print_generic_expr (dump_file, DR_ALIGNED_TO (dr), TDF_SLIM); DR_OFFSET_ALIGNMENT (dr));
fprintf (dump_file, "\n\tbase_object: "); fprintf (dump_file, "\n\tbase_object: ");
print_generic_expr (dump_file, DR_BASE_OBJECT (dr), TDF_SLIM); print_generic_expr (dump_file, DR_BASE_OBJECT (dr), TDF_SLIM);
fprintf (dump_file, "\n"); fprintf (dump_file, "\n");
......
...@@ -52,9 +52,10 @@ struct innermost_loop_behavior ...@@ -52,9 +52,10 @@ struct innermost_loop_behavior
tree init; tree init;
tree step; tree step;
/* Alignment information. ALIGNED_TO is set to the largest power of two /* The largest power of two that divides OFFSET, capped to a suitably
that divides OFFSET. */ high value if the offset is zero. This is a byte rather than a bit
tree aligned_to; quantity. */
unsigned int offset_alignment;
}; };
/* Describes the evolutions of indices of the memory reference. The indices /* Describes the evolutions of indices of the memory reference. The indices
...@@ -143,7 +144,7 @@ struct data_reference ...@@ -143,7 +144,7 @@ struct data_reference
#define DR_INIT(DR) (DR)->innermost.init #define DR_INIT(DR) (DR)->innermost.init
#define DR_STEP(DR) (DR)->innermost.step #define DR_STEP(DR) (DR)->innermost.step
#define DR_PTR_INFO(DR) (DR)->alias.ptr_info #define DR_PTR_INFO(DR) (DR)->alias.ptr_info
#define DR_ALIGNED_TO(DR) (DR)->innermost.aligned_to #define DR_OFFSET_ALIGNMENT(DR) (DR)->innermost.offset_alignment
#define DR_INNERMOST(DR) (DR)->innermost #define DR_INNERMOST(DR) (DR)->innermost
typedef struct data_reference *data_reference_p; typedef struct data_reference *data_reference_p;
......
...@@ -1441,11 +1441,8 @@ if_convertible_loop_p_1 (struct loop *loop, vec<data_reference_p> *refs) ...@@ -1441,11 +1441,8 @@ if_convertible_loop_p_1 (struct loop *loop, vec<data_reference_p> *refs)
|| TREE_CODE (ref) == REALPART_EXPR) || TREE_CODE (ref) == REALPART_EXPR)
ref = TREE_OPERAND (ref, 0); ref = TREE_OPERAND (ref, 0);
DR_BASE_ADDRESS (dr) = ref; memset (&DR_INNERMOST (dr), 0, sizeof (DR_INNERMOST (dr)));
DR_OFFSET (dr) = NULL; DR_BASE_ADDRESS (dr) = ref;
DR_INIT (dr) = NULL;
DR_STEP (dr) = NULL;
DR_ALIGNED_TO (dr) = NULL;
} }
hash_memrefs_baserefs_and_store_DRs_read_written_info (dr); hash_memrefs_baserefs_and_store_DRs_read_written_info (dr);
} }
......
...@@ -772,7 +772,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr) ...@@ -772,7 +772,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
alignment = TYPE_ALIGN_UNIT (vectype); alignment = TYPE_ALIGN_UNIT (vectype);
if ((compare_tree_int (drb->aligned_to, alignment) < 0) if (drb->offset_alignment < alignment
|| !step_preserves_misalignment_p) || !step_preserves_misalignment_p)
{ {
if (dump_enabled_p ()) if (dump_enabled_p ())
...@@ -3412,8 +3412,8 @@ again: ...@@ -3412,8 +3412,8 @@ again:
{ {
DR_OFFSET (newdr) = ssize_int (0); DR_OFFSET (newdr) = ssize_int (0);
DR_STEP (newdr) = step; DR_STEP (newdr) = step;
DR_ALIGNED_TO (newdr) DR_OFFSET_ALIGNMENT (newdr)
= size_int (BIGGEST_ALIGNMENT); = BIGGEST_ALIGNMENT;
dr = newdr; dr = newdr;
simd_lane_access = true; simd_lane_access = true;
} }
...@@ -3644,8 +3644,8 @@ again: ...@@ -3644,8 +3644,8 @@ again:
STMT_VINFO_DR_INIT (stmt_info) = outer_init; STMT_VINFO_DR_INIT (stmt_info) = outer_init;
STMT_VINFO_DR_OFFSET (stmt_info) = STMT_VINFO_DR_OFFSET (stmt_info) =
fold_convert (ssizetype, offset_iv.base); fold_convert (ssizetype, offset_iv.base);
STMT_VINFO_DR_ALIGNED_TO (stmt_info) = STMT_VINFO_DR_OFFSET_ALIGNMENT (stmt_info)
size_int (highest_pow2_factor (offset_iv.base)); = highest_pow2_factor (offset_iv.base);
if (dump_enabled_p ()) if (dump_enabled_p ())
{ {
...@@ -3663,10 +3663,8 @@ again: ...@@ -3663,10 +3663,8 @@ again:
dump_printf (MSG_NOTE, "\n\touter step: "); dump_printf (MSG_NOTE, "\n\touter step: ");
dump_generic_expr (MSG_NOTE, TDF_SLIM, dump_generic_expr (MSG_NOTE, TDF_SLIM,
STMT_VINFO_DR_STEP (stmt_info)); STMT_VINFO_DR_STEP (stmt_info));
dump_printf (MSG_NOTE, "\n\touter aligned to: "); dump_printf (MSG_NOTE, "\n\touter offset alignment: %d\n",
dump_generic_expr (MSG_NOTE, TDF_SLIM, STMT_VINFO_DR_OFFSET_ALIGNMENT (stmt_info));
STMT_VINFO_DR_ALIGNED_TO (stmt_info));
dump_printf (MSG_NOTE, "\n");
} }
} }
......
...@@ -709,7 +709,8 @@ STMT_VINFO_BB_VINFO (stmt_vec_info stmt_vinfo) ...@@ -709,7 +709,8 @@ STMT_VINFO_BB_VINFO (stmt_vec_info stmt_vinfo)
#define STMT_VINFO_DR_INIT(S) (S)->dr_wrt_vec_loop.init #define STMT_VINFO_DR_INIT(S) (S)->dr_wrt_vec_loop.init
#define STMT_VINFO_DR_OFFSET(S) (S)->dr_wrt_vec_loop.offset #define STMT_VINFO_DR_OFFSET(S) (S)->dr_wrt_vec_loop.offset
#define STMT_VINFO_DR_STEP(S) (S)->dr_wrt_vec_loop.step #define STMT_VINFO_DR_STEP(S) (S)->dr_wrt_vec_loop.step
#define STMT_VINFO_DR_ALIGNED_TO(S) (S)->dr_wrt_vec_loop.aligned_to #define STMT_VINFO_DR_OFFSET_ALIGNMENT(S) \
(S)->dr_wrt_vec_loop.offset_alignment
#define STMT_VINFO_IN_PATTERN_P(S) (S)->in_pattern_p #define STMT_VINFO_IN_PATTERN_P(S) (S)->in_pattern_p
#define STMT_VINFO_RELATED_STMT(S) (S)->related_stmt #define STMT_VINFO_RELATED_STMT(S) (S)->related_stmt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment