[llvm] TargetSchedule: factor out code in computeOperandLatency (NFC) (PR #73769)

Francesco Petrogalli via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 13:58:46 PST 2023


================
@@ -173,8 +173,11 @@ unsigned TargetSchedModel::computeOperandLatency(
   const MachineInstr *DefMI, unsigned DefOperIdx,
   const MachineInstr *UseMI, unsigned UseOperIdx) const {
 
+  unsigned InstrLatency = computeInstrLatency(DefMI);
+  unsigned DefaultDefLatency = TII->defaultDefLatency(SchedModel, *DefMI);
----------------
fpetrogalli wrote:

I'd suggest this:
```suggestion
  const unsigned InstrLatency = computeInstrLatency(DefMI);
  const unsigned DefaultDefLatency = TII->defaultDefLatency(SchedModel, *DefMI);
```

... especially for InstrLatency, which you are not modifying anymore in what was line 200

https://github.com/llvm/llvm-project/pull/73769


More information about the llvm-commits mailing list