diff options
author | Revital Eres <revital.eres@linaro.org> | 2011-09-30 13:10:56 +0000 |
---|---|---|
committer | Revital Eres <revitale@gcc.gnu.org> | 2011-09-30 13:10:56 +0000 |
commit | 442b891d022ef2a3a57fcc6210cab4bd9759902c (patch) | |
tree | 24e675ed3ce342877a15ea45c250d0032fc8eed0 /gcc/modulo-sched.c | |
parent | f27a3d372a48c2f3ef8e256a61020f23fa8b57d9 (diff) | |
download | gcc-442b891d022ef2a3a57fcc6210cab4bd9759902c.zip gcc-442b891d022ef2a3a57fcc6210cab4bd9759902c.tar.gz gcc-442b891d022ef2a3a57fcc6210cab4bd9759902c.tar.bz2 |
SMS: Avoid generating redundant reg-moves
From-SVN: r179380
Diffstat (limited to 'gcc/modulo-sched.c')
-rw-r--r-- | gcc/modulo-sched.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index 28be942..7c33be5 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -476,7 +476,12 @@ generate_reg_moves (partial_schedule_ptr ps, bool rescan) sbitmap *uses_of_defs; rtx last_reg_move; rtx prev_reg, old_reg; - + rtx set = single_set (u->insn); + + /* Skip instructions that do not set a register. */ + if ((set && !REG_P (SET_DEST (set)))) + continue; + /* Compute the number of reg_moves needed for u, by looking at life ranges started at u (excluding self-loops). */ for (e = u->out; e; e = e->next_out) @@ -493,6 +498,16 @@ generate_reg_moves (partial_schedule_ptr ps, bool rescan) && SCHED_COLUMN (e->dest) < SCHED_COLUMN (e->src)) nreg_moves4e--; + if (nreg_moves4e >= 1) + { + /* !single_set instructions are not supported yet and + thus we do not except to encounter them in the loop + except from the doloop part. For the latter case + we assume no regmoves are generated as the doloop + instructions are tied to the branch with an edge. */ + gcc_assert (set); + } + nreg_moves = MAX (nreg_moves, nreg_moves4e); } |