diff options
| author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-27 15:56:40 +0000 |
|---|---|---|
| committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-27 15:56:40 +0000 |
| commit | 8c4bd339767a4d09403c67772548c5c52efcb718 (patch) | |
| tree | 97296d105e28688bcbd1cdda2c2d61def5731c1c /gcc | |
| parent | bbb40a04698e4a849de12112553b54aeb9869d46 (diff) | |
| download | ppe42-gcc-8c4bd339767a4d09403c67772548c5c52efcb718.tar.gz ppe42-gcc-8c4bd339767a4d09403c67772548c5c52efcb718.zip | |
* gcse.c (hoist_code): Rewrite to only get list of dominated
blocks once per BB. Also fix reversed test (by removing need for
the test at all).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55031 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/gcse.c | 26 |
2 files changed, 22 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8b4df3f1cc6..273924b1374 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-06-27 Daniel Berlin <dberlin@dberlin.org> + + * gcse.c (hoist_code): Rewrite to only get list of dominated + blocks once per BB. Also fix reversed test (by removing need for + the test at all). + 2002-06-27 Neil Booth <neil@daikokuya.co.uk> * cpphash.h (_cpp_set_trad_context): Remove. diff --git a/gcc/gcse.c b/gcc/gcse.c index e73200840a2..daeaa909144 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -5911,7 +5911,9 @@ static void hoist_code () { basic_block bb, dominated; - unsigned int i; + basic_block *domby; + unsigned int domby_len; + unsigned int i,j; struct expr **index_map; struct expr *expr; @@ -5932,24 +5934,25 @@ hoist_code () int found = 0; int insn_inserted_p; + domby_len = get_dominated_by (dominators, bb, &domby); /* Examine each expression that is very busy at the exit of this block. These are the potentially hoistable expressions. */ for (i = 0; i < hoist_vbeout[bb->index]->n_bits; i++) { int hoistable = 0; - if (TEST_BIT (hoist_vbeout[bb->index], i) && TEST_BIT (transpout[bb->index], i)) + if (TEST_BIT (hoist_vbeout[bb->index], i) + && TEST_BIT (transpout[bb->index], i)) { /* We've found a potentially hoistable expression, now we look at every block BB dominates to see if it computes the expression. */ - FOR_EACH_BB (dominated) + for (j = 0; j < domby_len; j++) { + dominated = domby[j]; /* Ignore self dominance. */ - if (bb == dominated - || dominated_by_p (dominators, dominated, bb)) + if (bb == dominated) continue; - /* We've found a dominated block, now see if it computes the busy expression and whether or not moving that expression to the "beginning" of that block is safe. */ @@ -5982,10 +5985,12 @@ hoist_code () } } } - /* If we found nothing to hoist, then quit now. */ if (! found) + { + free (domby); continue; + } /* Loop over all the hoistable expressions. */ for (i = 0; i < hoist_exprs[bb->index]->n_bits; i++) @@ -6000,11 +6005,11 @@ hoist_code () /* We've found a potentially hoistable expression, now we look at every block BB dominates to see if it computes the expression. */ - FOR_EACH_BB (dominated) + for (j = 0; j < domby_len; j++) { + dominated = domby[j]; /* Ignore self dominance. */ - if (bb == dominated - || ! dominated_by_p (dominators, dominated, bb)) + if (bb == dominated) continue; /* We've found a dominated block, now see if it computes @@ -6058,6 +6063,7 @@ hoist_code () } } } + free (domby); } free (index_map); |

