diff options
| author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-29 16:01:16 +0000 |
|---|---|---|
| committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-29 16:01:16 +0000 |
| commit | bb9243aacf86284bbeb0abbd253e9b341e6cc51a (patch) | |
| tree | f060596743742d0cae12cca2eeb0302483bd36ff | |
| parent | d5ea8306947e939c0a598cac76806c50a97adf2d (diff) | |
| download | ppe42-gcc-bb9243aacf86284bbeb0abbd253e9b341e6cc51a.tar.gz ppe42-gcc-bb9243aacf86284bbeb0abbd253e9b341e6cc51a.zip | |
PR middle-end/27745
* lambda-code.c (perfect_nestify): Don't copy statements
in the inner loop: move them to the inner loop header.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114205 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/lambda-code.c | 42 |
2 files changed, 13 insertions, 35 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eba12e76fb2..dc310f69498 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-05-29 Sebastian Pop <pop@cri.ensmp.fr> + + PR middle-end/27745 + * lambda-code.c (perfect_nestify): Don't copy statements + in the inner loop: move them to the inner loop header. + 2006-05-29 Diego Novillo <dnovillo@redhat.com> PR 26237 diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c index 8ed9610c6b4..2a03fd31cd5 100644 --- a/gcc/lambda-code.c +++ b/gcc/lambda-code.c @@ -2506,50 +2506,22 @@ perfect_nestify (struct loops *loops, if (dominated_by_p (CDI_DOMINATORS, loop->inner->header, bbs[i])) { - for (bsi = bsi_last (bbs[i]); !bsi_end_p (bsi);) + block_stmt_iterator header_bsi + = bsi_after_labels (loop->inner->header); + + for (bsi = bsi_start (bbs[i]); !bsi_end_p (bsi);) { - use_operand_p use_p; - imm_use_iterator imm_iter; - tree imm_stmt; tree stmt = bsi_stmt (bsi); if (stmt == exit_condition || not_interesting_stmt (stmt) || stmt_is_bumper_for_loop (loop, stmt)) { - if (!bsi_end_p (bsi)) - bsi_prev (&bsi); + bsi_next (&bsi); continue; } - - /* Make copies of this statement to put it back next - to its uses. */ - FOR_EACH_IMM_USE_STMT (imm_stmt, imm_iter, - TREE_OPERAND (stmt, 0)) - { - if (!exit_phi_for_loop_p (loop->inner, imm_stmt)) - { - block_stmt_iterator tobsi; - tree newname; - tree newstmt; - - newstmt = unshare_expr (stmt); - tobsi = bsi_after_labels (bb_for_stmt (imm_stmt)); - newname = TREE_OPERAND (newstmt, 0); - newname = SSA_NAME_VAR (newname); - newname = make_ssa_name (newname, newstmt); - TREE_OPERAND (newstmt, 0) = newname; - - FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter) - SET_USE (use_p, newname); - - bsi_insert_before (&tobsi, newstmt, BSI_SAME_STMT); - update_stmt (newstmt); - update_stmt (imm_stmt); - } - } - if (!bsi_end_p (bsi)) - bsi_prev (&bsi); + + bsi_move_before (&bsi, &header_bsi); } } else |

