diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-02-20 09:03:18 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-02-20 09:03:18 +0000 |
commit | d2ec9d3b1c37c0e0b9c28d83a9caf108243743ca (patch) | |
tree | a254810adf6022c9e225c2fbfdb577cf13879091 | |
parent | 49858f84237c61d0c48e0c5af3f6331633e3b42b (diff) | |
download | gcc-d2ec9d3b1c37c0e0b9c28d83a9caf108243743ca.tar.gz |
2013-02-20 Richard Biener <rguenther@suse.de>
* tree-ssa-loop-ivopts.c (alloc_use_cost_map): Use bitmap_count_bits
and ceil_log2.
(get_use_iv_cost): Terminate hashtable walk when coming across
an empty entry.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196166 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 17 |
2 files changed, 15 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 005d9a12ac6..2a92d350a42 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,9 +1,17 @@ +2013-02-20 Richard Biener <rguenther@suse.de> + + * tree-ssa-loop-ivopts.c (alloc_use_cost_map): Use bitmap_count_bits + and ceil_log2. + (get_use_iv_cost): Terminate hashtable walk when coming across + an empty entry. + 2013-02-20 Igor Zamyatin <igor.zamyatin@intel.com> * config/i386/i386.c (initial_ix86_tune_features): Turn on fp reassociation for avx2 targets. 2012-02-19 Edgar E. Iglesias <edgar.iglesias@gmail.com> + * config/microblaze/microblaze.c: microblaze_has_clz = 0 Add version check for v8.10.a to enable microblaze_has_clz * config/microblaze/microblaze.h: Add TARGET_HAS_CLZ as combined diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index d30bfec5062..2940bf10044 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -2574,26 +2574,20 @@ record_important_candidates (struct ivopts_data *data) static void alloc_use_cost_map (struct ivopts_data *data) { - unsigned i, size, s, j; + unsigned i, size, s; for (i = 0; i < n_iv_uses (data); i++) { struct iv_use *use = iv_use (data, i); - bitmap_iterator bi; if (data->consider_all_candidates) size = n_iv_cands (data); else { - s = 0; - EXECUTE_IF_SET_IN_BITMAP (use->related_cands, 0, j, bi) - { - s++; - } + s = bitmap_count_bits (use->related_cands); /* Round up to the power of two, so that moduling by it is fast. */ - for (size = 1; size < s; size <<= 1) - continue; + size = s ? (1 << ceil_log2 (s)) : 1; } use->n_map_members = size; @@ -2731,10 +2725,13 @@ get_use_iv_cost (struct ivopts_data *data, struct iv_use *use, for (i = s; i < use->n_map_members; i++) if (use->cost_map[i].cand == cand) return use->cost_map + i; - + else if (use->cost_map[i].cand == NULL) + return NULL; for (i = 0; i < s; i++) if (use->cost_map[i].cand == cand) return use->cost_map + i; + else if (use->cost_map[i].cand == NULL) + return NULL; return NULL; } |