This is the mail archive of the
mailing list for the GCC project.
Re: Defining scheduling resource constraint
On 11/05/2012 03:51 PM, Paulo Matos wrote:
> I am experience a problem in GCC4.7 scheduler whereby the scheduler is issuing two instructions that write with a cond_exec to the same register. It ends up looking like this:
> Cond_exec p1 != 0 : r2 <- r2 and 0xf8
> Cond_exec p0 != 0: r2 <- 0x10
> This cannot happen, but I am unsure about which hook can be used to tell the scheduler about this.
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.