Message ID | 851240104.20101208214631@post.ru |
---|---|
State | New |
Headers | show |
On 12/08/10 11:46, Anatoly Sokolov wrote: > Hi. > > This patch converts loops of bitmap_set_bit/bitmap_clear_bit in to > bitmap_set_range/bitmap_clear_range functions call. > > The patch has been bootstrapped on and regression tested on > x86_64-unknown-linux-gnu for c. > > OK to install? > > * cfgcleanup.c (mark_effect): Use bitmap_set_range/bitmap_clear_range > instead of loop. Use HARD_REGISTER_NUM_P predicate. > * haifa-sched.c (setup_ref_regs): Ditto. > * caller-save.c (add_used_regs_1): Ditto. > * dse.c (look_for_hardregs): Ditto. > * df-problems.c (df_simulate_one_insn_forwards): Ditto. > * sched-rgn.c (check_live_1): Ditto. This looks like a reasonable cleanup, but I can't see how this fixes any kind of bug, so it should be postponed until stage1 reopens. If you could attach it to the GCC 4.7 pending patches metabug that would help ensure it doens't get lost. Thanks, Jeff
Hello. > On 12/08/10 11:46, Anatoly Sokolov wrote: >> Hi. >> >> This patch converts loops of bitmap_set_bit/bitmap_clear_bit in to >> bitmap_set_range/bitmap_clear_range functions call. >> >> The patch has been bootstrapped on and regression tested on >> x86_64-unknown-linux-gnu for c. >> >> OK to install? >> >> * cfgcleanup.c (mark_effect): Use >> bitmap_set_range/bitmap_clear_range >> instead of loop. Use HARD_REGISTER_NUM_P predicate. >> * haifa-sched.c (setup_ref_regs): Ditto. >> * caller-save.c (add_used_regs_1): Ditto. >> * dse.c (look_for_hardregs): Ditto. >> * df-problems.c (df_simulate_one_insn_forwards): Ditto. >> * sched-rgn.c (check_live_1): Ditto. > This looks like a reasonable cleanup, but I can't see how this fixes any > kind of bug, so it should be postponed until stage1 reopens. If you could > attach it to the GCC 4.7 pending patches metabug that would help ensure it > doens't get lost. > http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00686.html OK to commit? Anatoly.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 03/16/11 15:32, Anatoly Sokolov wrote: > Hello. > >> On 12/08/10 11:46, Anatoly Sokolov wrote: >>> Hi. >>> >>> This patch converts loops of bitmap_set_bit/bitmap_clear_bit in to >>> bitmap_set_range/bitmap_clear_range functions call. >>> >>> The patch has been bootstrapped on and regression tested on >>> x86_64-unknown-linux-gnu for c. >>> >>> OK to install? >>> >>> * cfgcleanup.c (mark_effect): Use >>> bitmap_set_range/bitmap_clear_range >>> instead of loop. Use HARD_REGISTER_NUM_P predicate. >>> * haifa-sched.c (setup_ref_regs): Ditto. >>> * caller-save.c (add_used_regs_1): Ditto. >>> * dse.c (look_for_hardregs): Ditto. >>> * df-problems.c (df_simulate_one_insn_forwards): Ditto. >>> * sched-rgn.c (check_live_1): Ditto. >> This looks like a reasonable cleanup, but I can't see how this fixes >> any kind of bug, so it should be postponed until stage1 reopens. If >> you could attach it to the GCC 4.7 pending patches metabug that would >> help ensure it doens't get lost. >> > > > http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00686.html > OK to commit? Yes. Please go ahead and commit. Thanks, Jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJNggvXAAoJEBRtltQi2kC7fbsH/0jO7ZgdD1srfPKi1mM0Os30 uR7I5R3lwh4i5q/+ENVG+7CLrL6TkvicYUo4Zm56kg82Cpj0UWt28y2jirBVtGaT gDAtV3kclzek5EspOizFKAc+0Ws0qpsnWITFBsyej7LxnpHVyqNzd+J8x43fDjYx ZCuohQ+Q0hP4ROofM2UpgpQZqkzmL2roAekIId3va1i8PJxEcMYBUDl3tlUF2ciN Fa7qdI0qwU/celFKz8a2/gguhq1f3KvD/tZ3ArhHH2GLsAxbfsud3EebKcZx3OkD /1/XOSpMyic/to5J6y8hnGglTOPmdvsWZ5nJ5pY+i8J5Atisod7JZm6KtGaZcGg= =J+wW -----END PGP SIGNATURE-----
Index: gcc/haifa-sched.c =================================================================== --- gcc/haifa-sched.c (revision 167598) +++ gcc/haifa-sched.c (working copy) @@ -672,11 +672,11 @@ if (REG_P (x)) { regno = REGNO (x); - if (regno >= FIRST_PSEUDO_REGISTER) + if (HARD_REGISTER_NUM_P (regno)) + bitmap_set_range (region_ref_regs, regno, + hard_regno_nregs[regno][GET_MODE (x)]); + else bitmap_set_bit (region_ref_regs, REGNO (x)); - else - for (i = hard_regno_nregs[regno][GET_MODE (x)] - 1; i >= 0; i--) - bitmap_set_bit (region_ref_regs, regno + i); return; } fmt = GET_RTX_FORMAT (code); Index: gcc/caller-save.c =================================================================== --- gcc/caller-save.c (revision 167598) +++ gcc/caller-save.c (working copy) @@ -1317,7 +1317,7 @@ static int add_used_regs_1 (rtx *loc, void *data) { - int regno, i; + unsigned int regno; regset live; rtx x; @@ -1326,11 +1326,10 @@ if (REG_P (x)) { regno = REGNO (x); - if (!HARD_REGISTER_NUM_P (regno)) + if (HARD_REGISTER_NUM_P (regno)) + bitmap_set_range (live, regno, hard_regno_nregs[regno][GET_MODE (x)]); + else regno = reg_renumber[regno]; - if (regno >= 0) - for (i = hard_regno_nregs[regno][GET_MODE (x)] - 1; i >= 0; i--) - SET_REGNO_REG_SET (live, regno + i); } return 0; } Index: gcc/dse.c =================================================================== --- gcc/dse.c (revision 167598) +++ gcc/dse.c (working copy) @@ -1781,12 +1781,11 @@ bitmap regs_set = (bitmap) data; if (REG_P (x) - && REGNO (x) < FIRST_PSEUDO_REGISTER) + && HARD_REGISTER_P (x)) { - int regno = REGNO (x); - int n = hard_regno_nregs[regno][GET_MODE (x)]; - while (--n >= 0) - bitmap_set_bit (regs_set, regno + n); + unsigned int regno = REGNO (x); + bitmap_set_range (regs_set, regno, + hard_regno_nregs[regno][GET_MODE (x)]); } } Index: gcc/cfgcleanup.c =================================================================== --- gcc/cfgcleanup.c (revision 167598) +++ gcc/cfgcleanup.c (working copy) @@ -204,13 +204,11 @@ { dest = XEXP (exp, 0); regno = REGNO (dest); - CLEAR_REGNO_REG_SET (nonequal, regno); - if (regno < FIRST_PSEUDO_REGISTER) - { - int n = hard_regno_nregs[regno][GET_MODE (dest)]; - while (--n > 0) - CLEAR_REGNO_REG_SET (nonequal, regno + n); - } + if (HARD_REGISTER_NUM_P (regno)) + bitmap_clear_range (nonequal, regno, + hard_regno_nregs[regno][GET_MODE (dest)]); + else + bitmap_clear_bit (nonequal, regno); } return false; @@ -223,13 +221,11 @@ if (!REG_P (dest)) return true; regno = REGNO (dest); - SET_REGNO_REG_SET (nonequal, regno); - if (regno < FIRST_PSEUDO_REGISTER) - { - int n = hard_regno_nregs[regno][GET_MODE (dest)]; - while (--n > 0) - SET_REGNO_REG_SET (nonequal, regno + n); - } + if (HARD_REGISTER_NUM_P (regno)) + bitmap_set_range (nonequal, regno, + hard_regno_nregs[regno][GET_MODE (dest)]); + else + bitmap_set_bit (nonequal, regno); return false; default: Index: gcc/df-problems.c =================================================================== --- gcc/df-problems.c (revision 167598) +++ gcc/df-problems.c (working copy) @@ -3752,12 +3752,9 @@ { rtx reg = XEXP (link, 0); int regno = REGNO (reg); - if (regno < FIRST_PSEUDO_REGISTER) - { - int n = hard_regno_nregs[regno][GET_MODE (reg)]; - while (--n >= 0) - bitmap_clear_bit (live, regno + n); - } + if (HARD_REGISTER_NUM_P (regno)) + bitmap_clear_range (live, regno, + hard_regno_nregs[regno][GET_MODE (reg)]); else bitmap_clear_bit (live, regno); } Index: gcc/sched-rgn.c =================================================================== --- gcc/sched-rgn.c (revision 167598) +++ gcc/sched-rgn.c (working copy) @@ -1762,30 +1762,19 @@ regno = REGNO (reg); - if (regno >= FIRST_PSEUDO_REGISTER || !global_regs[regno]) + if (! HARD_REGISTER_NUM_P (regno) + || !global_regs[regno]) { - if (regno < FIRST_PSEUDO_REGISTER) + for (i = 0; i < candidate_table[src].update_bbs.nr_members; i++) { - int j = hard_regno_nregs[regno][GET_MODE (reg)]; - while (--j >= 0) - { - for (i = 0; i < candidate_table[src].update_bbs.nr_members; i++) - { - basic_block b = candidate_table[src].update_bbs.first_member[i]; + basic_block b = candidate_table[src].update_bbs.first_member[i]; - SET_REGNO_REG_SET (df_get_live_in (b), regno + j); - } - } + if (HARD_REGISTER_NUM_P (regno)) + bitmap_set_range (df_get_live_in (b), regno, + hard_regno_nregs[regno][GET_MODE (reg)]); + else + bitmap_set_bit (df_get_live_in (b), regno); } - else - { - for (i = 0; i < candidate_table[src].update_bbs.nr_members; i++) - { - basic_block b = candidate_table[src].update_bbs.first_member[i]; - - SET_REGNO_REG_SET (df_get_live_in (b), regno); - } - } } }