* Delay-slot calculation. Follows fanin/fanout.
*/
-static unsigned delay_calc2(struct ir3_sched_ctx *ctx,
+/* calculate delay for specified src: */
+static unsigned delay_calc_srcn(struct ir3_sched_ctx *ctx,
struct ir3_instruction *assigner,
struct ir3_instruction *consumer, unsigned srcn)
{
for (i = 1; i < assigner->regs_count; i++) {
struct ir3_register *reg = assigner->regs[i];
if (reg->flags & IR3_REG_SSA) {
- unsigned d = delay_calc2(ctx, reg->instr,
+ unsigned d = delay_calc_srcn(ctx, reg->instr,
consumer, srcn);
delay = MAX2(delay, d);
}
return delay;
}
+/* calculate delay for instruction (maximum of delay for all srcs): */
static unsigned delay_calc(struct ir3_sched_ctx *ctx,
struct ir3_instruction *instr)
{
for (i = 1; i < instr->regs_count; i++) {
struct ir3_register *reg = instr->regs[i];
if (reg->flags & IR3_REG_SSA) {
- unsigned d = delay_calc2(ctx, reg->instr,
+ unsigned d = delay_calc_srcn(ctx, reg->instr,
instr, i - 1);
delay = MAX2(delay, d);
}