diff options
author | Michael Matz <matzmich@cs.tu-berlin.de> | 2000-07-21 00:07:33 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2000-07-20 18:07:33 -0600 |
commit | 274969ea8e357380c3b8d8516e94bf4e26ff9cbe (patch) | |
tree | f90d57c3d5e2996dc54ebe2a6fdefbf8714163ff /gcc/gcse.c | |
parent | 7be50fd30fa08028f2ea7ac281cd0a310151d3b9 (diff) | |
download | gcc-274969ea8e357380c3b8d8516e94bf4e26ff9cbe.zip gcc-274969ea8e357380c3b8d8516e94bf4e26ff9cbe.tar.gz gcc-274969ea8e357380c3b8d8516e94bf4e26ff9cbe.tar.bz2 |
gcse.c (record_one_set): Prepend instead of append onto reg_set_table, making it O(n) instead O(n^2).
* gcse.c (record_one_set): Prepend instead of append onto
reg_set_table, making it O(n) instead O(n^2).
* lcm.c (compute_antinout_edge,compute_laterin,compute_available):
Use a queue instead of a stack as worklist.
From-SVN: r35158
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -1140,21 +1140,8 @@ record_one_set (regno, insn) sizeof (struct reg_set)); bytes_used += sizeof (struct reg_set); new_reg_info->insn = insn; - new_reg_info->next = NULL; - if (reg_set_table[regno] == NULL) - reg_set_table[regno] = new_reg_info; - else - { - reg_info_ptr1 = reg_info_ptr2 = reg_set_table[regno]; - /* ??? One could keep a "last" pointer to speed this up. */ - while (reg_info_ptr1 != NULL) - { - reg_info_ptr2 = reg_info_ptr1; - reg_info_ptr1 = reg_info_ptr1->next; - } - - reg_info_ptr2->next = new_reg_info; - } + new_reg_info->next = reg_set_table[regno]; + reg_set_table[regno] = new_reg_info; } /* Called from compute_sets via note_stores to handle one SET or CLOBBER in |