This is the mail archive of the
mailing list for the GCC project.
RE: Defining scheduling resource constraint
> -----Original Message-----
> From: Bernd Schmidt [mailto:firstname.lastname@example.org]
> Sent: 05 November 2012 16:52
> To: Paulo Matos
> Cc: email@example.com
> Subject: Re: Defining scheduling resource constraint
> Depends on why it schedules them in the same cycle. Either there's an
> output dependency, in which case your target's adjust_cost needs to
> ensure it doesn't have cost zero. Or maybe the scheduler proved that the
> conditions are mutually exclusive and didn't add such a dependency. In
> that case, if the machine really disallows this case, you'll probably
> need to define the sched_reorg hooks and maybe variable_issue and do the
> bookkeeping yourself - keep track of which registers have been set in
> the current cycle, and ensure insns which set the same registers go to
> the back of the queue and aren't considered anymore until the next cycle.
I am following your advice and using sched.reorg to remove the instruction from the ready list.
What I am doing is checking the register written in ready[n_ready - 1] (if any) and look for the remainder of the ready list for insns writing to the same register.
If I find one such insn, in index k, then I remove the insn by moving all insns from 0 -> k-1 to 1-> k (essentially shifting right all instructions below k.
However this is getting me into trouble with an ice. I feel like I should instead be moving the instruction from ready to pending instead of simply removing it from ready, however I have no access to Haifa-sched.c internals from the backend.
Any suggestions on how to remove this instruction? Or do I need to keep more scheduling state in the backend in order to do this properly?