Commit 1e373390 by Richard Guenther Committed by Richard Biener

tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Return whether we failed…

tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Return whether we failed to compute data dependences.

2012-05-07  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Return
	whether we failed to compute data dependences.
	(loop_prefetch_arrays): Fail if we failed.

From-SVN: r187227
parent e3a2ec56
2012-05-07 Richard Guenther <rguenther@suse.de>
* tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Return
whether we failed to compute data dependences.
(loop_prefetch_arrays): Fail if we failed.
2012-05-07 Uros Bizjak <ubizjak@gmail.com> 2012-05-07 Uros Bizjak <ubizjak@gmail.com>
Paolo Bonzini <bonzini@gnu.org> Paolo Bonzini <bonzini@gnu.org>
......
...@@ -1495,9 +1495,9 @@ self_reuse_distance (data_reference_p dr, unsigned *loop_sizes, unsigned n, ...@@ -1495,9 +1495,9 @@ self_reuse_distance (data_reference_p dr, unsigned *loop_sizes, unsigned n,
/* Determines the distance till the first reuse of each reference in REFS /* Determines the distance till the first reuse of each reference in REFS
in the loop nest of LOOP. NO_OTHER_REFS is true if there are no other in the loop nest of LOOP. NO_OTHER_REFS is true if there are no other
memory references in the loop. */ memory references in the loop. Return false if the analysis fails. */
static void static bool
determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs, determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs,
bool no_other_refs) bool no_other_refs)
{ {
...@@ -1515,7 +1515,7 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs, ...@@ -1515,7 +1515,7 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs,
ddr_p dep; ddr_p dep;
if (loop->inner) if (loop->inner)
return; return true;
/* Find the outermost loop of the loop nest of loop (we require that /* Find the outermost loop of the loop nest of loop (we require that
there are no sibling loops inside the nest). */ there are no sibling loops inside the nest). */
...@@ -1585,7 +1585,8 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs, ...@@ -1585,7 +1585,8 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs,
ref->independent_p = true; ref->independent_p = true;
} }
compute_all_dependences (datarefs, &dependences, vloops, true); if (!compute_all_dependences (datarefs, &dependences, vloops, true))
return false;
FOR_EACH_VEC_ELT (ddr_p, dependences, i, dep) FOR_EACH_VEC_ELT (ddr_p, dependences, i, dep)
{ {
...@@ -1664,6 +1665,8 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs, ...@@ -1664,6 +1665,8 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs,
fprintf (dump_file, " ref %p distance %u\n", fprintf (dump_file, " ref %p distance %u\n",
(void *) ref, ref->reuse_distance); (void *) ref, ref->reuse_distance);
} }
return true;
} }
/* Determine whether or not the trip count to ahead ratio is too small based /* Determine whether or not the trip count to ahead ratio is too small based
...@@ -1826,7 +1829,8 @@ loop_prefetch_arrays (struct loop *loop) ...@@ -1826,7 +1829,8 @@ loop_prefetch_arrays (struct loop *loop)
if (nothing_to_prefetch_p (refs)) if (nothing_to_prefetch_p (refs))
goto fail; goto fail;
determine_loop_nest_reuse (loop, refs, no_other_refs); if (!determine_loop_nest_reuse (loop, refs, no_other_refs))
goto fail;
/* Step 3: determine unroll factor. */ /* Step 3: determine unroll factor. */
unroll_factor = determine_unroll_factor (loop, refs, ninsns, &desc, unroll_factor = determine_unroll_factor (loop, refs, ninsns, &desc,
......
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