[schedule] What is the meaning of setting output latency = 0 in out-of-order mode?

  • In function computeOutputLatency, we only set the output Latency = 1 for in-order mode schedule.
  if (!SchedModel.isOutOfOrder()) {
    return HandleOutputDep ? computeInOrderOutputLatency(DefMI, DepMI) : 1;
  }
  • In fact, we can’t issue the Output depedence successor instruction in priority even when the Out Latency=0, so what’s the different if we set the latency = 1 ?
SU(1):   %38:zpr = LD1D %23:ppr_3b, %13:gpr64common, %57:gpr64common :: (load unknown-size from %ir.scevgep1516, align 1)
  # preds left       : 1
  # succs left       : 4
  # rdefs left       : 0
  Latency            : 4
  Depth              : 1
  Height             : 24
  Predecessors:
    SU(0): Data Latency=1 Reg=%23
  Successors:
    SU(2): Data Latency=4 Reg=%38
    SU(2): Out  Latency=0  ----- the SU(2) will not be issued before SU(1)
    SU(34): Anti Latency=0
    SU(30): Ord  Latency=0 Barrier
  Pressure Diff      : PPR_3b 1    PPR 1    GPR32 1    ZPR -2
  Single Issue       : false;
SU(2):   %38:zpr = AND_ZPmZ_D %23:ppr_3b, %38:zpr(tied-def 0), %25:zpr

In this case there is no difference because you also have Data dependency between the same units with Latency == 4.