Hello, > > OK, this makes sense. Just to re-confirm, the exact same edges are created > in both cases, right?
No, sorry for not been more clear on this. The previous implementation will actually create redundant anti-dep edges. This happens when the definition that is used in jump_insn is defined more than once in bb. The previous implementation created an edge between jump_insn and it's def in this case. This edge is redundant as anti-dep edge between jump_insn to the first definition in the bb is also created (in add_cross_iteration_register) and will prevent the creation of reg-moves if -fmodulo-sched-allow-regmoves is set, which is why we created this edge in the first place. Here is the full explanation: In add_cross_iteration_register an inter iteration anti-dep edges are created between instructions that have intra true dep edge in the opposite direction (def insn -> True dep -> use insn). When -fmodulo-sched-allow-regmoves is set certain inter anti dep edge are not been created. These edges are avoided when there is only one definition in bb for the register defined in the def insn. The previous implementation added anti-dep edge between jump_insn and def insn even when there is more than one definition to def insn in bb although add_cross_iteration_register does not abort the creation of anti-dep edges in this case (this edge will be created between jump_insn to the first_def insn). The new patch implements a different approach -- instead of creating additional anti-deps edge it will not abort the creation of anti-dep edges when use insn is jump_insn. Thanks, Revital