From patchwork Wed Oct 31 17:43:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lawrence Crowl X-Patchwork-Id: 195962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 963832C0193 for ; Thu, 1 Nov 2012 04:43:35 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1352310215; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=7jABA8o ZE5B5VPpDnWCbXXV41yE=; b=IYNlwxrOxflC87UZQtBuzZkbCrsNh/+4399aZm+ o+C4dzV1ANbXUiSqCZOGOE+L4xaSbQQQr56ADeX5M3lac57R+GM8kVI/94PM897K v8EoWPmhPyp+DgIfP1fwtqft3hUh8AvB3y/SbNeydo8LTq2D58qsdftk2qhAfuio mf5U= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-System-Of-Record:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=EZFCzIKAusSTO3lcDfdrNcvYoeG/m1iz1OpCr8M7iEv7TiPqBT2SeN5AxZBwjj wXxfIb1DHZHYTeaSeXAJ+cg6aGWikZVitqaftwYXkP/qSWlJgjyOTKmOlCOxq1+O UC8anp8anMr8rQSD5AJYGBY8gxKwvoB3dJKCpAX/PP84E=; Received: (qmail 10751 invoked by alias); 31 Oct 2012 17:43:26 -0000 Received: (qmail 10667 invoked by uid 22791); 31 Oct 2012 17:43:24 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, TW_DD X-Spam-Check-By: sourceware.org Received: from mail-ie0-f175.google.com (HELO mail-ie0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 31 Oct 2012 17:43:08 +0000 Received: by mail-ie0-f175.google.com with SMTP id c13so2695156ieb.20 for ; Wed, 31 Oct 2012 10:43:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type :x-system-of-record:x-gm-message-state; bh=hAl4Rl6fMYEwIyyPrJWEvIqVSsHG2YEyWWsrx1M3KF0=; b=pePNSZUKctX+Ep/eVuuwX62rbxzPV1agfnBBIeTYlBo3lvyn9aOWSFKvnnpou8dOB/ LnpymqSjupmtwFF1q+ohg6l1Y5wjP1l0K0XYFO9araecABJXZOls0uMMjx0SOy60onPk keCtGmNc/A53MbrCGbxXEuYIxS2PAOAO8LKh9OL8o1/xu3go/CXpN4PGUEzD7QR+OlQq MqinnUud1j/Gc91/MHXUuAS8vTeVtm7MqtjGUUzIO1OX3KQq5CY04AC17RYxqC99H4+9 mH5xr1h8jCXFvASWtbJCdEAd8ig846jBmtmHMnzlT1+UhotKU8Kf5+nBgoG9q1PH5BsL rL7Q== MIME-Version: 1.0 Received: by 10.50.91.195 with SMTP id cg3mr2347038igb.57.1351705387813; Wed, 31 Oct 2012 10:43:07 -0700 (PDT) Received: by 10.231.72.19 with HTTP; Wed, 31 Oct 2012 10:43:07 -0700 (PDT) Date: Wed, 31 Oct 2012 10:43:07 -0700 Message-ID: Subject: [patch] Normalize bitmap iteration. From: Lawrence Crowl To: Richard Biener , gcc-patches List Cc: Diego Novillo X-System-Of-Record: true X-Gm-Message-State: ALoCoQm3T/NUbOA57lAiSfVPTps7TKB/YyyZCErbE52vRkWHHFGU7NQ6RZgXTge4k83WsOjGE8PKy0VR5GSTzTIACWkQkvF/0Wu/4spwR4B+1wXrBcQiL/FzVhFGoan6LRkVQknMzrDuFyGxFdZB9P3w7hGR+aMwfrnRM0QJ1yTc8z0WTinq77iXTpDA9Gayl9q59NWRW2ud X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch renames sbitmap iterators to unify them with the bitmap iterators. Remove the unused EXECUTE_IF_SET_IN_SBITMAP_REV, which has an unconventional interface. Rename the sbitmap_iter_* functions to match bitmap's bmp_iter_* functions. Add an additional parameter to the initialization and next functions to match the interface in bmp_iter_*. This extra parameter is mostly hidden by the use of the EXECUTE_IF macros. Rename the EXECUTE_IF_SET_IN_SBITMAP macro to EXECUTE_IF_SET_IN_BITMAP. Its implementation is now identical to that in bitmap.h. To prevent redefinition errors, both definitions are now guarded by #ifndef. An alternate strategy is to simply include bitmap.h from sbitmap.h. As this would increase build time, I have elected to use the #ifndef version. I do not have a strong preference here. The sbitmap_iterator type is still distinctly named because it is often declared in contexts where the bitmap type is not obvious. There are less than 40 uses of this type, so the burden to modify it when changing bitmap types is not large. Tested on x86-64, config-list.mk testing in progress. Okay for trunk? Index: gcc/ChangeLog 2012-10-31 Lawrence Crowl * sbitmap.h (sbitmap_iter_init): Rename bmp_iter_set_init and add unused parameter to match bitmap iterator. Update callers. (sbitmap_iter_cond): Rename bmp_iter_set. Update callers. (sbitmap_iter_next): Rename bmp_iter_next and add unused parameter to match bitmap iterator. Update callers. (EXECUTE_IF_SET_IN_SBITMAP_REV): Remove unused. (EXECUTE_IF_SET_IN_SBITMAP): Rename EXECUTE_IF_SET_IN_BITMAP and adjust to be identical to the definition in bitmap.h. Conditionalize the definition based on not having been defined. Update callers. * bitmap.h (EXECUTE_IF_SET_IN_BITMAP): Conditionalize the definition based on not having been defined. (To match the above.) Index: gcc/tree-into-ssa.c =================================================================== --- gcc/tree-into-ssa.c (revision 193006) +++ gcc/tree-into-ssa.c (working copy) @@ -2672,12 +2672,12 @@ prepare_names_to_update (bool insert_phi /* First process names in NEW_SSA_NAMES. Otherwise, uses of old names may be considered to be live-in on blocks that contain definitions for their replacements. */ - EXECUTE_IF_SET_IN_SBITMAP (new_ssa_names, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (new_ssa_names, 0, i, sbi) prepare_def_site_for (ssa_name (i), insert_phi_p); /* If an old name is in NAMES_TO_RELEASE, we cannot remove it from OLD_SSA_NAMES, but we have to ignore its definition site. */ - EXECUTE_IF_SET_IN_SBITMAP (old_ssa_names, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (old_ssa_names, 0, i, sbi) { if (names_to_release == NULL || !bitmap_bit_p (names_to_release, i)) prepare_def_site_for (ssa_name (i), insert_phi_p); @@ -2737,7 +2737,7 @@ dump_update_ssa (FILE *file) fprintf (file, "N_i -> { O_1 ... O_j } means that N_i replaces " "O_1, ..., O_j\n\n"); - EXECUTE_IF_SET_IN_SBITMAP (new_ssa_names, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (new_ssa_names, 0, i, sbi) dump_names_replaced_by (file, ssa_name (i)); } @@ -3241,7 +3241,7 @@ update_ssa (unsigned update_flags) for traversal. */ sbitmap tmp = sbitmap_alloc (SBITMAP_SIZE (old_ssa_names)); bitmap_copy (tmp, old_ssa_names); - EXECUTE_IF_SET_IN_SBITMAP (tmp, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (tmp, 0, i, sbi) insert_updated_phi_nodes_for (ssa_name (i), dfs, blocks_to_update, update_flags); sbitmap_free (tmp); @@ -3265,7 +3265,7 @@ update_ssa (unsigned update_flags) /* Reset the current definition for name and symbol before renaming the sub-graph. */ - EXECUTE_IF_SET_IN_SBITMAP (old_ssa_names, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (old_ssa_names, 0, i, sbi) get_ssa_name_ann (ssa_name (i))->info.current_def = NULL_TREE; FOR_EACH_VEC_ELT (tree, symbols_to_rename, i, sym) Index: gcc/sbitmap.c =================================================================== --- gcc/sbitmap.c (revision 193006) +++ gcc/sbitmap.c (working copy) @@ -656,7 +656,7 @@ bitmap_first_set_bit (const_sbitmap bmap unsigned int n = 0; sbitmap_iterator sbi; - EXECUTE_IF_SET_IN_SBITMAP (bmap, 0, n, sbi) + EXECUTE_IF_SET_IN_BITMAP (bmap, 0, n, sbi) return n; return -1; } Index: gcc/sbitmap.h =================================================================== --- gcc/sbitmap.h (revision 193006) +++ gcc/sbitmap.h (working copy) @@ -45,7 +45,7 @@ along with GCC; see the file COPYING3. * cardinality : sbitmap_popcount * choose_one : bitmap_first_set_bit / bitmap_last_set_bit - * forall : EXECUTE_IF_SET_IN_SBITMAP + * forall : EXECUTE_IF_SET_IN_BITMAP * set_copy : bitmap_copy / bitmap_copy_n * set_intersection : bitmap_and * set_union : bitmap_ior @@ -177,7 +177,8 @@ typedef struct { MIN. */ static inline void -sbitmap_iter_init (sbitmap_iterator *i, const_sbitmap bmp, unsigned int min) +bmp_iter_set_init (sbitmap_iterator *i, const_sbitmap bmp, + unsigned int min, unsigned *bit_no ATTRIBUTE_UNUSED) { i->word_num = min / (unsigned int) SBITMAP_ELT_BITS; i->bit_num = min; @@ -196,7 +197,7 @@ sbitmap_iter_init (sbitmap_iterator *i, false. */ static inline bool -sbitmap_iter_cond (sbitmap_iterator *i, unsigned int *n) +bmp_iter_set (sbitmap_iterator *i, unsigned int *n) { /* Skip words that are zeros. */ for (; i->word == 0; i->word = i->ptr[i->word_num]) @@ -222,7 +223,7 @@ sbitmap_iter_cond (sbitmap_iterator *i, /* Advance to the next bit. */ static inline void -sbitmap_iter_next (sbitmap_iterator *i) +bmp_iter_next (sbitmap_iterator *i, unsigned *bit_no ATTRIBUTE_UNUSED) { i->word >>= 1; i->bit_num++; @@ -232,38 +233,13 @@ sbitmap_iter_next (sbitmap_iterator *i) iteration, N is set to the index of the bit being visited. ITER is an instance of sbitmap_iterator used to iterate the bitmap. */ -#define EXECUTE_IF_SET_IN_SBITMAP(SBITMAP, MIN, N, ITER) \ - for (sbitmap_iter_init (&(ITER), (SBITMAP), (MIN)); \ - sbitmap_iter_cond (&(ITER), &(N)); \ - sbitmap_iter_next (&(ITER))) - -#define EXECUTE_IF_SET_IN_SBITMAP_REV(SBITMAP, N, CODE) \ -do { \ - unsigned int word_num_; \ - unsigned int bit_num_; \ - unsigned int size_ = (SBITMAP)->size; \ - SBITMAP_ELT_TYPE *ptr_ = (SBITMAP)->elms; \ - \ - for (word_num_ = size_; word_num_ > 0; word_num_--) \ - { \ - SBITMAP_ELT_TYPE word_ = ptr_[word_num_ - 1]; \ - \ - if (word_ != 0) \ - for (bit_num_ = SBITMAP_ELT_BITS; bit_num_ > 0; bit_num_--) \ - { \ - SBITMAP_ELT_TYPE _mask = (SBITMAP_ELT_TYPE)1 << (bit_num_ - 1);\ - \ - if ((word_ & _mask) != 0) \ - { \ - word_ &= ~ _mask; \ - (N) = (word_num_ - 1) * SBITMAP_ELT_BITS + bit_num_ - 1;\ - CODE; \ - if (word_ == 0) \ - break; \ - } \ - } \ - } \ -} while (0) +#ifndef EXECUTE_IF_SET_IN_BITMAP +/* See bitmap.h for the other definition of EXECUTE_IF_SET_IN_BITMAP. */ +#define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, ITER) \ + for (bmp_iter_set_init (&(ITER), (BITMAP), (MIN), &(BITNUM)); \ + bmp_iter_set (&(ITER), &(BITNUM)); \ + bmp_iter_next (&(ITER), &(BITNUM))) +#endif inline void sbitmap_free (sbitmap map) { Index: gcc/bitmap.h =================================================================== --- gcc/bitmap.h (revision 193006) +++ gcc/bitmap.h (working copy) @@ -682,10 +682,13 @@ bmp_iter_and_compl (bitmap_iterator *bi, should be treated as a read-only variable as it contains loop state. */ +#ifndef EXECUTE_IF_SET_IN_BITMAP +/* See sbitmap.h for the other definition of EXECUTE_IF_SET_IN_BITMAP. */ #define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, ITER) \ for (bmp_iter_set_init (&(ITER), (BITMAP), (MIN), &(BITNUM)); \ bmp_iter_set (&(ITER), &(BITNUM)); \ bmp_iter_next (&(ITER), &(BITNUM))) +#endif /* Loop over all the bits set in BITMAP1 & BITMAP2, starting with MIN and setting BITNUM to the bit number. ITER is a bitmap iterator. Index: gcc/ddg.c =================================================================== --- gcc/ddg.c (revision 193006) +++ gcc/ddg.c (working copy) @@ -801,7 +801,7 @@ print_sccs (FILE *file, ddg_all_sccs_ptr for (i = 0; i < sccs->num_sccs; i++) { fprintf (file, "SCC number: %d\n", i); - EXECUTE_IF_SET_IN_SBITMAP (sccs->sccs[i]->nodes, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (sccs->sccs[i]->nodes, 0, u, sbi) { fprintf (file, "insn num %d\n", u); print_rtl_single (file, g->nodes[u].insn); @@ -893,7 +893,7 @@ create_scc (ddg_ptr g, sbitmap nodes) bitmap_copy (scc->nodes, nodes); /* Mark the backarcs that belong to this SCC. */ - EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (nodes, 0, u, sbi) { ddg_edge_ptr e; ddg_node_ptr n = &g->nodes[u]; @@ -977,7 +977,7 @@ find_successors (sbitmap succ, ddg_ptr g unsigned int i = 0; sbitmap_iterator sbi; - EXECUTE_IF_SET_IN_SBITMAP (ops, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (ops, 0, i, sbi) { const sbitmap node_succ = NODE_SUCCESSORS (&g->nodes[i]); bitmap_ior (succ, succ, node_succ); @@ -996,7 +996,7 @@ find_predecessors (sbitmap preds, ddg_pt unsigned int i = 0; sbitmap_iterator sbi; - EXECUTE_IF_SET_IN_SBITMAP (ops, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (ops, 0, i, sbi) { const sbitmap node_preds = NODE_PREDECESSORS (&g->nodes[i]); bitmap_ior (preds, preds, node_preds); @@ -1141,7 +1141,7 @@ find_nodes_on_paths (sbitmap result, ddg change = 0; bitmap_copy (workset, tmp); bitmap_clear (tmp); - EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (workset, 0, u, sbi) { ddg_edge_ptr e; ddg_node_ptr u_node = &g->nodes[u]; @@ -1170,7 +1170,7 @@ find_nodes_on_paths (sbitmap result, ddg change = 0; bitmap_copy (workset, tmp); bitmap_clear (tmp); - EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (workset, 0, u, sbi) { ddg_edge_ptr e; ddg_node_ptr u_node = &g->nodes[u]; @@ -1257,7 +1257,7 @@ longest_simple_path (struct ddg * g, int change = 0; bitmap_copy (workset, tmp); bitmap_clear (tmp); - EXECUTE_IF_SET_IN_SBITMAP (workset, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (workset, 0, u, sbi) { ddg_node_ptr u_node = &g->nodes[u]; Index: gcc/modulo-sched.c =================================================================== --- gcc/modulo-sched.c (revision 193006) +++ gcc/modulo-sched.c (working copy) @@ -615,7 +615,7 @@ schedule_reg_move (partial_schedule_ptr /* Handle the dependencies between the move and previously-scheduled successors. */ - EXECUTE_IF_SET_IN_SBITMAP (move->uses, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (move->uses, 0, u, sbi) { this_insn = ps_rtl_insn (ps, u); this_latency = insn_latency (move->insn, this_insn); @@ -829,7 +829,7 @@ apply_reg_moves (partial_schedule_ptr ps unsigned int i_use; sbitmap_iterator sbi; - EXECUTE_IF_SET_IN_SBITMAP (move->uses, 0, i_use, sbi) + EXECUTE_IF_SET_IN_BITMAP (move->uses, 0, i_use, sbi) { replace_rtx (ps->g->nodes[i_use].insn, move->old_reg, move->new_reg); df_insn_rescan (ps->g->nodes[i_use].insn); @@ -2664,7 +2664,7 @@ find_max_asap (ddg_ptr g, sbitmap nodes) int result = -1; sbitmap_iterator sbi; - EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (nodes, 0, u, sbi) { ddg_node_ptr u_node = &g->nodes[u]; @@ -2686,7 +2686,7 @@ find_max_hv_min_mob (ddg_ptr g, sbitmap int result = -1; sbitmap_iterator sbi; - EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (nodes, 0, u, sbi) { ddg_node_ptr u_node = &g->nodes[u]; @@ -2715,7 +2715,7 @@ find_max_dv_min_mob (ddg_ptr g, sbitmap int result = -1; sbitmap_iterator sbi; - EXECUTE_IF_SET_IN_SBITMAP (nodes, 0, u, sbi) + EXECUTE_IF_SET_IN_BITMAP (nodes, 0, u, sbi) { ddg_node_ptr u_node = &g->nodes[u]; Index: gcc/lra-lives.c =================================================================== --- gcc/lra-lives.c (revision 193006) +++ gcc/lra-lives.c (working copy) @@ -789,7 +789,7 @@ remove_some_program_points_and_update_li map = XCNEWVEC (int, lra_live_max_point); n = -1; prev_born_p = prev_dead_p = false; - EXECUTE_IF_SET_IN_SBITMAP (born_or_dead, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (born_or_dead, 0, i, sbi) { born_p = TEST_BIT (born, i); dead_p = TEST_BIT (dead, i); Index: gcc/dse.c =================================================================== --- gcc/dse.c (revision 193006) +++ gcc/dse.c (working copy) @@ -3414,7 +3414,7 @@ dse_step3 (bool for_spills) /* For any block in an infinite loop, we must initialize the out set to all ones. This could be expensive, but almost never occurs in practice. However, it is common in regression tests. */ - EXECUTE_IF_SET_IN_SBITMAP (unreachable_blocks, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (unreachable_blocks, 0, i, sbi) { if (bitmap_bit_p (all_blocks, i)) { Index: gcc/ira-lives.c =================================================================== --- gcc/ira-lives.c (revision 193006) +++ gcc/ira-lives.c (working copy) @@ -1480,7 +1480,7 @@ remove_some_program_points_and_update_li map = (int *) ira_allocate (sizeof (int) * ira_max_point); n = -1; prev_born_p = prev_dead_p = false; - EXECUTE_IF_SET_IN_SBITMAP (born_or_dead, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (born_or_dead, 0, i, sbi) { born_p = TEST_BIT (born, i); dead_p = TEST_BIT (dead, i); Index: gcc/ebitmap.c =================================================================== --- gcc/ebitmap.c (revision 193006) +++ gcc/ebitmap.c (working copy) @@ -438,7 +438,7 @@ bitmap_and_into (ebitmap dst, ebitmap sr the result, AND'ing them. */ bitmap_and (dst->wordmask, dst->wordmask, src->wordmask); - EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (dst->wordmask, 0, i, sbi) { EBITMAP_ELT_TYPE tmpword = ebitmap_array_get (src, srceltindex++); tmpword &= ebitmap_array_get (dst, dsteltindex++); @@ -490,7 +490,7 @@ bitmap_and (ebitmap dst, ebitmap src1, e 0); bitmap_and (dst->wordmask, src1->wordmask, src2->wordmask); - EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (dst->wordmask, 0, i, sbi) { bool src1hasword, src2hasword; @@ -598,7 +598,7 @@ bitmap_ior_into (ebitmap dst, ebitmap sr newarraysize = src->numwords + dst->numwords; newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize); - EXECUTE_IF_SET_IN_SBITMAP (tempmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (tempmask, 0, i, sbi) { bool dsthasword, srchasword; @@ -707,7 +707,7 @@ bitmap_ior (ebitmap dst, ebitmap src1, e newarraysize = src1->numwords + src2->numwords; newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize); - EXECUTE_IF_SET_IN_SBITMAP (tempmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (tempmask, 0, i, sbi) { bool src1hasword, src2hasword; EBITMAP_ELT_TYPE tmpword; @@ -803,7 +803,7 @@ bitmap_and_compl_into (ebitmap dst, ebit if (src->numwords == 0) return false; - EXECUTE_IF_SET_IN_SBITMAP (dst->wordmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (dst->wordmask, 0, i, sbi) { bool srchasword; @@ -886,7 +886,7 @@ bitmap_and_compl (ebitmap dst, ebitmap s newarraysize = src1->numwords; newarray = XNEWVEC (EBITMAP_ELT_TYPE, newarraysize); - EXECUTE_IF_SET_IN_SBITMAP (src1->wordmask, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (src1->wordmask, 0, i, sbi) { bool src2hasword; EBITMAP_ELT_TYPE tmpword; Index: gcc/ebitmap.h =================================================================== --- gcc/ebitmap.h (revision 193006) +++ gcc/ebitmap.h (working copy) @@ -94,8 +94,9 @@ typedef struct { static inline void ebitmap_iter_init (ebitmap_iterator *i, ebitmap bmp, unsigned int min) { - sbitmap_iter_init (&i->maskiter, bmp->wordmask, - min / EBITMAP_ELT_BITS); + unsigned unused; + bmp_iter_set_init (&i->maskiter, bmp->wordmask, + min / EBITMAP_ELT_BITS, &unused); i->size = bmp->numwords; if (i->size == 0) { @@ -131,14 +132,15 @@ static inline bool ebitmap_iter_cond (ebitmap_iterator *i, unsigned int *n) { unsigned int ourn = 0; + unsigned unused; if (i->size == 0) return false; if (i->word == 0) { - sbitmap_iter_next (&i->maskiter); - if (!sbitmap_iter_cond (&i->maskiter, &ourn)) + bmp_iter_next (&i->maskiter, &unused); + if (!bmp_iter_set (&i->maskiter, &ourn)) return false; i->bit_num = ourn * EBITMAP_ELT_BITS; i->word = i->ptr[i->eltnum++]; Index: gcc/gcse.c =================================================================== --- gcc/gcse.c (revision 193006) +++ gcc/gcse.c (working copy) @@ -1930,7 +1930,7 @@ prune_insertions_deletions (int n_elems) needs to be inserted. */ for (i = 0; i < (unsigned) n_edges; i++) { - EXECUTE_IF_SET_IN_SBITMAP (pre_insert_map[i], 0, j, sbi) + EXECUTE_IF_SET_IN_BITMAP (pre_insert_map[i], 0, j, sbi) insertions[j]++; } @@ -1938,7 +1938,7 @@ prune_insertions_deletions (int n_elems) edges. */ for (i = 0; i < (unsigned) last_basic_block; i++) { - EXECUTE_IF_SET_IN_SBITMAP (pre_delete_map[i], 0, j, sbi) + EXECUTE_IF_SET_IN_BITMAP (pre_delete_map[i], 0, j, sbi) deletions[j]++; } @@ -1952,7 +1952,7 @@ prune_insertions_deletions (int n_elems) SET_BIT (prune_exprs, j); /* Now prune PRE_INSERT_MAP and PRE_DELETE_MAP based on PRUNE_EXPRS. */ - EXECUTE_IF_SET_IN_SBITMAP (prune_exprs, 0, j, sbi) + EXECUTE_IF_SET_IN_BITMAP (prune_exprs, 0, j, sbi) { for (i = 0; i < (unsigned) n_edges; i++) RESET_BIT (pre_insert_map[i], j); @@ -2943,7 +2943,7 @@ should_hoist_expr_to_dom (basic_block ex pressure for basic blocks newly added in hoisted_bbs. */ if (flag_ira_hoist_pressure && !pred) { - EXECUTE_IF_SET_IN_SBITMAP (visited, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (visited, 0, i, sbi) if (!bitmap_bit_p (hoisted_bbs, i)) { bitmap_set_bit (hoisted_bbs, i); Index: gcc/lower-subreg.c =================================================================== --- gcc/lower-subreg.c (revision 193006) +++ gcc/lower-subreg.c (working copy) @@ -1589,7 +1589,7 @@ decompose_multiword_subregs (bool decomp of a basic block, split those blocks now. Note that we only handle the case where splitting a load has caused multiple possibly trapping loads to appear. */ - EXECUTE_IF_SET_IN_SBITMAP (sub_blocks, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (sub_blocks, 0, i, sbi) { rtx insn, end; edge fallthru; Index: gcc/bt-load.c =================================================================== --- gcc/bt-load.c (revision 193006) +++ gcc/bt-load.c (working copy) @@ -720,7 +720,7 @@ link_btr_uses (btr_def *def_array, btr_u reaching_defs, btr_defset[reg - first_btr]); } - EXECUTE_IF_SET_IN_SBITMAP (reaching_defs_of_reg, 0, uid, sbi) + EXECUTE_IF_SET_IN_BITMAP (reaching_defs_of_reg, 0, uid, sbi) { btr_def def = def_array[uid]; Index: gcc/sched-rgn.c =================================================================== --- gcc/sched-rgn.c (revision 193006) +++ gcc/sched-rgn.c (working copy) @@ -342,7 +342,7 @@ extract_edgelst (sbitmap set, edgelst *e el->nr_members = 0; /* Iterate over each word in the bitset. */ - EXECUTE_IF_SET_IN_SBITMAP (set, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (set, 0, i, sbi) { edgelst_table[edgelst_last++] = rgn_edges[i]; el->nr_members++; Index: gcc/tree-ssa-reassoc.c =================================================================== --- gcc/tree-ssa-reassoc.c (revision 193006) +++ gcc/tree-ssa-reassoc.c (working copy) @@ -1324,7 +1324,7 @@ undistribute_ops_list (enum tree_code op ctable = htab_create (15, oecount_hash, oecount_eq, NULL); subops = XCNEWVEC (VEC (operand_entry_t, heap) *, VEC_length (operand_entry_t, *ops)); - EXECUTE_IF_SET_IN_SBITMAP (candidates, 0, i, sbi0) + EXECUTE_IF_SET_IN_BITMAP (candidates, 0, i, sbi0) { gimple oedef; enum tree_code oecode; @@ -1389,7 +1389,7 @@ undistribute_ops_list (enum tree_code op the common operand in their inner chain. */ bitmap_clear (candidates2); nr_candidates2 = 0; - EXECUTE_IF_SET_IN_SBITMAP (candidates, 0, i, sbi0) + EXECUTE_IF_SET_IN_BITMAP (candidates, 0, i, sbi0) { gimple oedef; enum tree_code oecode; @@ -1431,7 +1431,7 @@ undistribute_ops_list (enum tree_code op print_generic_expr (dump_file, oe1->op, 0); } zero_one_operation (&oe1->op, c->oecode, c->op); - EXECUTE_IF_SET_IN_SBITMAP (candidates2, first+1, i, sbi0) + EXECUTE_IF_SET_IN_BITMAP (candidates2, first+1, i, sbi0) { gimple sum; oe2 = VEC_index (operand_entry_t, *ops, i); Index: gcc/config/i386/i386.c =================================================================== --- gcc/config/i386/i386.c (revision 193006) +++ gcc/config/i386/i386.c (working copy) @@ -24803,7 +24803,7 @@ core2i7_first_cycle_multipass_backtrack sbitmap_iterator sbi; gcc_assert (bitmap_last_set_bit (data->ready_try_change) < n_ready); - EXECUTE_IF_SET_IN_SBITMAP (data->ready_try_change, 0, i, sbi) + EXECUTE_IF_SET_IN_BITMAP (data->ready_try_change, 0, i, sbi) { ready_try[i] = 0; }