Commit 80cad5fa by Zdenek Dvorak Committed by Zdenek Dvorak

tree-ssa-loop-ivopts.c (struct ivopts_data): New field important_candidates.

	* tree-ssa-loop-ivopts.c (struct ivopts_data): New field important_candidates.
	(find_best_candidate): Take also important candidates into account.
	(find_optimal_iv_set): Initialize important_candidates bitmap.

From-SVN: r89146
parent f59b0bd4
2004-10-16 Zdenek Dvorak <dvorakz@suse.cz> 2004-10-16 Zdenek Dvorak <dvorakz@suse.cz>
* tree-ssa-loop-ivopts.c (struct ivopts_data): New field important_candidates.
(find_best_candidate): Take also important candidates into account.
(find_optimal_iv_set): Initialize important_candidates bitmap.
2004-10-16 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/17560 PR tree-optimization/17560
* predict.c (tree_estimate_probability): Mark irreducible * predict.c (tree_estimate_probability): Mark irreducible
loops. loops.
......
...@@ -219,6 +219,9 @@ struct ivopts_data ...@@ -219,6 +219,9 @@ struct ivopts_data
/* The candidates. */ /* The candidates. */
varray_type iv_candidates; varray_type iv_candidates;
/* A bitmap of important candidates. */
bitmap important_candidates;
/* Whether to consider just related and important candidates when replacing a /* Whether to consider just related and important candidates when replacing a
use. */ use. */
bool consider_all_candidates; bool consider_all_candidates;
...@@ -3474,7 +3477,9 @@ find_best_candidate (struct ivopts_data *data, ...@@ -3474,7 +3477,9 @@ find_best_candidate (struct ivopts_data *data,
else else
{ {
asol = BITMAP_XMALLOC (); asol = BITMAP_XMALLOC ();
bitmap_a_and_b (asol, sol, use->related_cands);
bitmap_a_or_b (asol, data->important_candidates, use->related_cands);
bitmap_a_and_b (asol, asol, sol);
} }
EXECUTE_IF_SET_IN_BITMAP (asol, 0, c, bi) EXECUTE_IF_SET_IN_BITMAP (asol, 0, c, bi)
...@@ -3741,6 +3746,15 @@ find_optimal_iv_set (struct ivopts_data *data) ...@@ -3741,6 +3746,15 @@ find_optimal_iv_set (struct ivopts_data *data)
bitmap inv = BITMAP_XMALLOC (); bitmap inv = BITMAP_XMALLOC ();
struct iv_use *use; struct iv_use *use;
data->important_candidates = BITMAP_XMALLOC ();
for (i = 0; i < n_iv_cands (data); i++)
{
struct iv_cand *cand = iv_cand (data, i);
if (cand->important)
bitmap_set_bit (data->important_candidates, i);
}
/* Set the upper bound. */ /* Set the upper bound. */
cost = get_initial_solution (data, set, inv); cost = get_initial_solution (data, set, inv);
if (cost == INFTY) if (cost == INFTY)
...@@ -3783,6 +3797,7 @@ find_optimal_iv_set (struct ivopts_data *data) ...@@ -3783,6 +3797,7 @@ find_optimal_iv_set (struct ivopts_data *data)
} }
BITMAP_XFREE (inv); BITMAP_XFREE (inv);
BITMAP_XFREE (data->important_candidates);
return set; return set;
} }
......
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