[llvm] [AArch64] Implement latency costs for loads (PR #201567)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 00:48:50 PDT 2026


================
@@ -5115,7 +5117,9 @@ InstructionCost AArch64TTIImpl::getMemoryOpCost(unsigned Opcode, Type *Ty,
     const MCSchedModel &Sched = ST->getSchedModel();
     const TargetInstrInfo *TII = ST->getInstrInfo();
     unsigned SchedClass = TII->get(Inst).getSchedClass();
-    return (LT.first - 1) + Sched.computeInstrLatency(*ST, SchedClass);
+    const MCSchedClassDesc *SCD = Sched.getSchedClassDesc(SchedClass);
+    return (LT.first - 1) * Sched.getReciprocalThroughput(*ST, *SCD) +
+           Sched.computeInstrLatency(*ST, *SCD);
----------------
sdesmalen-arm wrote:

Yes, you're absolutely right, I had my wires crossed about throughput. The way it works now seems correct to me, thanks!

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


More information about the llvm-commits mailing list