Message ID | CAHz1=dXfE0x1ypVuetxkRMD5DTfKhx6y_-9pDOX+GmtErsHsOw@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Fri, Sep 30, 2011 at 10:03 AM, Revital Eres <revital.eres@linaro.org> wrote: > Hello, > >> This >> + /* Skip instructions that do not set a register. */ >> + if (set && !REG_P (SET_DEST (set))) >> + continue; >> is ok. Can you also prevent !set insns from having reg_moves? (To be updated >> once auto_inc insns will be supported, if they'll deserve reg_moves too.) > > I added a check to verify that no reg-moves are created for !set instructions. > > Currently re-testing on ppc64-redhat-linux (bootstrap and regtest) and > arm-linux-gnueabi (bootstrap c). > > OK to commit once tesing completes? > OK. later case >> latter case. Ayal. > Thanks, > Revital > > gcc/ > * modulo-sched.c (generate_reg_moves): Skip instructions that > do not set a register and verify no regmoves are created for > !single_set instructions. > > > testsuite/ > * gcc.dg/sms-10.c: New file. >
Index: modulo-sched.c =================================================================== --- modulo-sched.c (revision 179138) +++ modulo-sched.c (working copy) @@ -476,7 +476,12 @@ generate_reg_moves (partial_schedule_ptr 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 && 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 later 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); }