Thanks for the suggestions! I take a look at adjust_priority, and find it may not guarantee to schedule cmp and jmp together. The priority is used to choose a candidate from ready list. If cmp is the only insn in ready list and there is another insn-A in queued set (insn-A's dependence has been resolved, but it is not ready because of data delay or resource delay), then cmp will be scheduled before insn-A no matter what their priorities are.
I will take a look at whether SCHED_GROUP is going to work. On Wed, Sep 4, 2013 at 12:33 PM, Alexander Monakov <amona...@ispras.ru> wrote: > On Wed, Sep 4, 2013 at 9:53 PM, Steven Bosscher <stevenb....@gmail.com> wrote: >> >> On Wed, Sep 4, 2013 at 10:58 AM, Alexander Monakov wrote: >> > Hello, >> > >> > Could you use the existing facilities instead, such as adjust_priority >> > hook, >> > or making the compare-branch insn sequence a SCHED_GROUP? >> >> >> Or a define_bypass? > > Hm, I don't think define_bypass would work: it still leaves the > scheduler freedom to move the compare up. > > IMO adjust_priority would be preferable if it allows to achieve the goal. > > Alexander