On Mon, Sep 26, 2011 at 7:31 AM, Revital Eres <revital.e...@linaro.org> wrote: > Hello, > > This patch extends the implementation to support instructions with > REG_INC notes. > It addresses the comments from the previous submission: > http://gcc.gnu.org/ml/gcc-patches/2011-08/msg01299.html. >
ok, so if we have an auto-inc'ing insn which defines (auto-inc's) an addr register and another (say, result) register, we want to allow the result register to have life ranges in excess of ii (by eliminating anti-dep edges of distance 1 from uses to def, and generating reg_moves if/where needed), but avoid having such life ranges of addr (by retaining such anti-dep edges). Right? > btw, regarding your previous question about the usage of the address > register been auto inc, apparently it can be used as follows: > > insn 1) def1 = MEM [ pre_dec (addr) ] > out edges: [1 -(T,2,1)-> 1] [1 -(T,2,0)-> 2] > in edges: [1 -(T,2,1)-> 1] [2 -(T,2,1)-> 1] [2 -(A,0,1)->1] > > insn 2) MEM [ addr + 3 ] = def1 > out edges: [2 -(T,2,1)-> 1] [2 -(A,0,1)->1] > in edges: [1 -(T,2,0)-> 2] > Are these all the edges? We have only one True dependence edge from insn 1 to insn 2, but insn 1 is setting two registers both used by insn 2 (regardless of what we decide to do with Anti-deps). As for Anti-deps of distance 1, we have only one going back from insn 2 to insn 1, perhaps corresponding to addr, allowing reg_moves for def1(?). But, it won't help def1, because this other Anti-dep will force them to be scheduled w/o reg_moves. > Reg-moves were not created for the address when testing on ppc. ok; note that the example above shows one could potentially have an insn 2 scheduled in a later stage than insn 1, wanting to feed off an earlier version of the pre_dec'd addr. (In this case, it would probably be better to update the offset (3) than use a reg_move for the addr. (Such folding might work for other cases as well(?))). > > Tested and bootstrap with patch 1 on ppc64-redhat-linux > enabling SMS on loops with SC 1. On arm-linux-gnueabi bootstrap > c on top of the set of patches that support do-loop pattern > (http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01807.html) which solves > the bootstrap failure on ARM with SMS flags. > > OK for mainline? > OK, with the following comments: Make sure reg_moves are generated for the correct (result, not addr) register, in generate_reg_moves(). "been">>"being" (multiple appearances). Add a note that autoinc_var_is_used_p (rtx def_insn, rtx use_insn) doesn't need to consider the specific address register; no reg_moves will be allowed for any life range defined by def_insn and used by use_insn, if use_insn uses an address register auto-inc'ed by def_insn. In other words, one would expect to see two Anti-dep edges from insn 2 to insn 1, right? Ayal. > Thanks, > Revital > > > * ddg.c (autoinc_var_is_used_p): New function. > (create_ddg_dep_from_intra_loop_link, > add_cross_iteration_register_deps): Call it. > * modulo-sched.c (sms_schedule): Handle instructions with REG_INC. >