struct mem_ref *next; /* The next reference in the group. */
};
-/* Dumps information obout reference REF to FILE. */
+/* Dumps information about reference REF to FILE. */
static void
dump_mem_ref (FILE *file, struct mem_ref *ref)
if (cst_and_fits_in_hwi (ibase))
{
idelta += int_cst_value (ibase);
- ibase = build_int_cst_type (TREE_TYPE (ibase), 0);
+ ibase = build_int_cst (TREE_TYPE (ibase), 0);
}
if (TREE_CODE (base) == ARRAY_REF)
return true;
}
-/* Tries to express REF in shape &BASE + STEP * iter + DELTA, where DELTA and
+/* Tries to express REF_P in shape &BASE + STEP * iter + DELTA, where DELTA and
STEP are integer constants and iter is number of iterations of LOOP. The
- reference occurs in statement STMT. */
+ reference occurs in statement STMT. Strips nonaddressable component
+ references from REF_P. */
static bool
-analyze_ref (struct loop *loop, tree ref, tree *base,
+analyze_ref (struct loop *loop, tree *ref_p, tree *base,
HOST_WIDE_INT *step, HOST_WIDE_INT *delta,
tree stmt)
{
struct ar_data ar_data;
tree off;
HOST_WIDE_INT bit_offset;
+ tree ref = *ref_p;
*step = 0;
*delta = 0;
&& DECL_NONADDRESSABLE_P (TREE_OPERAND (ref, 1)))
ref = TREE_OPERAND (ref, 0);
+ *ref_p = ref;
+
for (; TREE_CODE (ref) == COMPONENT_REF; ref = TREE_OPERAND (ref, 0))
{
off = DECL_FIELD_BIT_OFFSET (TREE_OPERAND (ref, 1));
HOST_WIDE_INT step, delta;
struct mem_ref_group *agrp;
- if (!analyze_ref (loop, ref, &base, &step, &delta, stmt))
+ if (!analyze_ref (loop, &ref, &base, &step, &delta, stmt))
return;
/* Now we know that REF = &BASE + STEP * iter + DELTA, where DELTA and STEP
/* Issue prefetches for the reference REF into loop as decided before.
HEAD is the number of iterations to prefetch ahead. UNROLL_FACTOR
- is the factor by thet LOOP was unrolled. */
+ is the factor by which LOOP was unrolled. */
static void
issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
/* Issue prefetch instructions for array references in LOOPS. */
-void
+unsigned int
tree_ssa_prefetch_arrays (struct loops *loops)
{
unsigned i;
struct loop *loop;
bool unrolled = false;
+ int todo_flags = 0;
if (!HAVE_prefetch
/* It is possible to ask compiler for say -mtune=i486 -march=pentium4.
of processor costs and i486 does not have prefetch, but
-march=pentium4 causes HAVE_prefetch to be true. Ugh. */
|| PREFETCH_BLOCK == 0)
- return;
+ return 0;
initialize_original_copy_tables ();
if (unrolled)
{
scev_reset ();
- cleanup_tree_cfg_loop ();
+ todo_flags |= TODO_cleanup_cfg;
}
free_original_copy_tables ();
+ return todo_flags;
}