+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
drb->offset = fold_convert (ssizetype, offset_iv.base);
drb->init = init;
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))
fprintf (dump_file, "success.\n");
print_generic_expr (dump_file, DR_INIT (dr), TDF_SLIM);
fprintf (dump_file, "\n\tstep: ");
print_generic_expr (dump_file, DR_STEP (dr), TDF_SLIM);
- fprintf (dump_file, "\n\taligned to: ");
- print_generic_expr (dump_file, DR_ALIGNED_TO (dr), TDF_SLIM);
+ fprintf (dump_file, "\n\toffset alignment: %d",
+ DR_OFFSET_ALIGNMENT (dr));
fprintf (dump_file, "\n\tbase_object: ");
print_generic_expr (dump_file, DR_BASE_OBJECT (dr), TDF_SLIM);
fprintf (dump_file, "\n");
tree init;
tree step;
- /* Alignment information. ALIGNED_TO is set to the largest power of two
- that divides OFFSET. */
- tree aligned_to;
+ /* The largest power of two that divides OFFSET, capped to a suitably
+ high value if the offset is zero. This is a byte rather than a bit
+ quantity. */
+ unsigned int offset_alignment;
};
/* Describes the evolutions of indices of the memory reference. The indices
#define DR_INIT(DR) (DR)->innermost.init
#define DR_STEP(DR) (DR)->innermost.step
#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
typedef struct data_reference *data_reference_p;
|| TREE_CODE (ref) == REALPART_EXPR)
ref = TREE_OPERAND (ref, 0);
- DR_BASE_ADDRESS (dr) = ref;
- DR_OFFSET (dr) = NULL;
- DR_INIT (dr) = NULL;
- DR_STEP (dr) = NULL;
- DR_ALIGNED_TO (dr) = NULL;
+ memset (&DR_INNERMOST (dr), 0, sizeof (DR_INNERMOST (dr)));
+ DR_BASE_ADDRESS (dr) = ref;
}
hash_memrefs_baserefs_and_store_DRs_read_written_info (dr);
}
alignment = TYPE_ALIGN_UNIT (vectype);
- if ((compare_tree_int (drb->aligned_to, alignment) < 0)
+ if (drb->offset_alignment < alignment
|| !step_preserves_misalignment_p)
{
if (dump_enabled_p ())
{
DR_OFFSET (newdr) = ssize_int (0);
DR_STEP (newdr) = step;
- DR_ALIGNED_TO (newdr)
- = size_int (BIGGEST_ALIGNMENT);
+ DR_OFFSET_ALIGNMENT (newdr)
+ = BIGGEST_ALIGNMENT;
dr = newdr;
simd_lane_access = true;
}
STMT_VINFO_DR_INIT (stmt_info) = outer_init;
STMT_VINFO_DR_OFFSET (stmt_info) =
fold_convert (ssizetype, offset_iv.base);
- STMT_VINFO_DR_ALIGNED_TO (stmt_info) =
- size_int (highest_pow2_factor (offset_iv.base));
+ STMT_VINFO_DR_OFFSET_ALIGNMENT (stmt_info)
+ = highest_pow2_factor (offset_iv.base);
if (dump_enabled_p ())
{
dump_printf (MSG_NOTE, "\n\touter step: ");
dump_generic_expr (MSG_NOTE, TDF_SLIM,
STMT_VINFO_DR_STEP (stmt_info));
- dump_printf (MSG_NOTE, "\n\touter aligned to: ");
- dump_generic_expr (MSG_NOTE, TDF_SLIM,
- STMT_VINFO_DR_ALIGNED_TO (stmt_info));
- dump_printf (MSG_NOTE, "\n");
+ dump_printf (MSG_NOTE, "\n\touter offset alignment: %d\n",
+ STMT_VINFO_DR_OFFSET_ALIGNMENT (stmt_info));
}
}
#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_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_RELATED_STMT(S) (S)->related_stmt