diff options
| author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-10 05:30:28 +0000 |
|---|---|---|
| committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-10 05:30:28 +0000 |
| commit | 240b4fb26309863f06c218dbf1af693ea7d84958 (patch) | |
| tree | 73d65cac827c1016f9fef47f276875dc6a6acec3 | |
| parent | b7e644ba4600ba3ba49b889d0ddbde68ff3a6f2a (diff) | |
| download | ppe42-gcc-240b4fb26309863f06c218dbf1af693ea7d84958.tar.gz ppe42-gcc-240b4fb26309863f06c218dbf1af693ea7d84958.zip | |
* gcse.c (gcse_main): Avoid global optimizations if we have a
large number of basic blocks and the ratio of edges to blocks
is high.
(delete_null_pointer_checks): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29882 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/gcse.c | 30 |
2 files changed, 37 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index da2340a6fea..340125313c9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Sat Oct 9 23:26:55 1999 Jeffrey A Law (law@cygnus.com) + + * gcse.c (gcse_main): Avoid global optimizations if we have a + large number of basic blocks and the ratio of edges to blocks + is high. + (delete_null_pointer_checks): Likewise. + Sat Oct 9 23:16:01 1999 Ken Raeburn <raeburn@mit.edu> * c-common.c (check_format_info): Warn if format string isn't a diff --git a/gcc/gcse.c b/gcc/gcse.c index def34898cd7..cc9d2666dfb 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -672,6 +672,21 @@ gcse_main (f, file) return 0; } + /* Trying to perform global optimizations on flow graphs which have + a high connectivity will take a long time and is unlikely to be + particularly useful. + + In normal circumstances a cfg should have about twice has many edges + as blocks. But we do not want to punish small functions which have + a couple switch statements. So we require a relatively large number + of basic blocks and the ratio of edges to blocks to be high. */ + if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20) + { + /* Free storage allocated by find_basic_blocks. */ + free_basic_block_vars (0); + return 0; + } + /* See what modes support reg/reg copy operations. */ if (! can_copy_init_p) { @@ -4908,6 +4923,21 @@ delete_null_pointer_checks (f) return; } + /* Trying to perform global optimizations on flow graphs which have + a high connectivity will take a long time and is unlikely to be + particularly useful. + + In normal circumstances a cfg should have about twice has many edges + as blocks. But we do not want to punish small functions which have + a couple switch statements. So we require a relatively large number + of basic blocks and the ratio of edges to blocks to be high. */ + if (n_basic_blocks > 1000 && n_edges / n_basic_blocks >= 20) + { + /* Free storage allocated by find_basic_blocks. */ + free_basic_block_vars (0); + return 0; + } + /* We need predecessor/successor lists as well as pred/succ counts for each basic block. */ s_preds = (int_list_ptr *) alloca (n_basic_blocks * sizeof (int_list_ptr)); |

