aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1998-03-25 15:58:40 -0700
committerJeff Law <law@gcc.gnu.org>1998-03-25 15:58:40 -0700
commit7eea64437a974d93e6a99163ecb3d1b97d1c7e0d (patch)
treef8ea138a4bb0bdb07c16f9bb76170f286a051b98 /gcc
parentb09fa78719a041808a6cdb39517cba95a47cb4a7 (diff)
downloadgcc-7eea64437a974d93e6a99163ecb3d1b97d1c7e0d.zip
gcc-7eea64437a974d93e6a99163ecb3d1b97d1c7e0d.tar.gz
gcc-7eea64437a974d93e6a99163ecb3d1b97d1c7e0d.tar.bz2
haifa-sched.c (find_post_sched_live): Use EXECUTE_IF_SET_IN_REG_SET instead of calling REGNO_REG_SET_P for each pseudo.
* haifa-sched.c (find_post_sched_live): Use EXECUTE_IF_SET_IN_REG_SET instead of calling REGNO_REG_SET_P for each pseudo. (update_reg_usage): Likewise. (compute_block_backward)dependences): Do not call "free_list" for an empty list. Improves compile times by about 7% on average on my PAs. From-SVN: r18835
Diffstat (limited to 'gcc')
-rw-r--r--gcc/haifa-sched.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 3863e20..967e868 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -5163,9 +5163,10 @@ find_post_sched_live (bb)
next_tail = NEXT_INSN (tail);
prev_head = PREV_INSN (head);
- for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
- if (REGNO_REG_SET_P (bb_live_regs, i))
- sched_reg_basic_block[i] = REG_BLOCK_GLOBAL;
+ EXECUTE_IF_SET_IN_REG_SET (bb_live_regs, FIRST_PSEUDO_REGISTER, i,
+ {
+ sched_reg_basic_block[i] = REG_BLOCK_GLOBAL;
+ });
/* if the block is empty, same regs are alive at its end and its start.
since this is not guaranteed after interblock scheduling, make sure they
@@ -5314,9 +5315,11 @@ update_reg_usage ()
int regno;
if (n_basic_blocks > 0)
- for (regno = FIRST_PSEUDO_REGISTER; regno < max_regno; regno++)
- if (REGNO_REG_SET_P (basic_block_live_at_start[0], regno))
- sched_reg_basic_block[regno] = REG_BLOCK_GLOBAL;
+ EXECUTE_IF_SET_IN_REG_SET (bb_live_regs, FIRST_PSEUDO_REGISTER, regno,
+ {
+ sched_reg_basic_block[regno]
+ = REG_BLOCK_GLOBAL;
+ });
for (regno = 0; regno < max_regno; regno++)
if (sched_reg_live_length[regno])
@@ -7220,11 +7223,19 @@ compute_block_backward_dependences (bb)
while (e != first_edge);
}
- /* Free up the INSN_LISTs */
+ /* Free up the INSN_LISTs
+
+ Note this loop is executed max_reg * nr_regions times. It's first
+ implementation accounted for over 90% of the calls to free_list.
+ The list was empty for the vast majority of those calls. On the PA,
+ not calling free_list in those cases improves -O2 compile times by
+ 3-5% on average. */
for (b = 0; b < max_reg; ++b)
{
- free_list (&reg_last_sets[b], &unused_insn_list);
- free_list (&reg_last_uses[b], &unused_insn_list);
+ if (reg_last_sets[b])
+ free_list (&reg_last_sets[b], &unused_insn_list);
+ if (reg_last_uses[b])
+ free_list (&reg_last_uses[b], &unused_insn_list);
}
/* Assert that we won't need bb_reg_last_* for this block anymore. */