diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-16 16:49:53 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-16 16:49:53 +0000 |
commit | 0a501ca61f3e4bc9da771b30929311bca9cb166b (patch) | |
tree | 44606bf9ab44f65ab4dfa8b82f013615abb9f0d6 /gcc/tree-ssa-loop-ivopts.c | |
parent | 4843abb035526cf4fc0b9153720c0c812af210b8 (diff) | |
download | gcc-0a501ca61f3e4bc9da771b30929311bca9cb166b.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89146 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 93ff3b74ce9..70379dd1ddf 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -219,6 +219,9 @@ struct ivopts_data /* The candidates. */ varray_type iv_candidates; + /* A bitmap of important candidates. */ + bitmap important_candidates; + /* Whether to consider just related and important candidates when replacing a use. */ bool consider_all_candidates; @@ -3474,7 +3477,9 @@ find_best_candidate (struct ivopts_data *data, else { 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) @@ -3741,6 +3746,15 @@ find_optimal_iv_set (struct ivopts_data *data) bitmap inv = BITMAP_XMALLOC (); 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. */ cost = get_initial_solution (data, set, inv); if (cost == INFTY) @@ -3783,6 +3797,7 @@ find_optimal_iv_set (struct ivopts_data *data) } BITMAP_XFREE (inv); + BITMAP_XFREE (data->important_candidates); return set; } |