[llvm] [MCA] Extend -instruction-tables option with verbosity levels (PR #130574)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 23 19:05:22 PDT 2025


================
@@ -141,6 +241,33 @@ void InstructionInfoView::collectData(
     IIVDEntry.mayLoad = MCDesc.mayLoad();
     IIVDEntry.mayStore = MCDesc.mayStore();
     IIVDEntry.hasUnmodeledSideEffects = MCDesc.hasUnmodeledSideEffects();
+
+    if (PrintFullInfo) {
+      // Get latency with bypass
+      IIVDEntry.Bypass =
+          IIVDEntry.Latency - MCSchedModel::getBypassDelayCycles(STI, SCDesc);
+      IIVDEntry.OpcodeName = MCII.getName(Inst.getOpcode());
+      raw_string_ostream TempStream(IIVDEntry.Resources);
+      const MCWriteProcResEntry *Index = STI.getWriteProcResBegin(&SCDesc);
+      const MCWriteProcResEntry *Last = STI.getWriteProcResEnd(&SCDesc);
+      auto Sep = "";
+      for (; Index != Last; ++Index) {
+        if (!Index->ReleaseAtCycle)
+          continue;
+        const MCProcResourceDesc *MCProc =
+            SM.getProcResource(Index->ProcResourceIdx);
+        if (Index->ReleaseAtCycle > 1) {
----------------
mshockwave wrote:

Alright, you nerd-sniped me and I've proved that we should indeed use the largest `(ReleaseAtCycle - AcquireAtCycle) / NumUnits` as inverse throughput...but the reason behind it is not so simple: https://myhsu.xyz/llvm-sched-interval-throughput
I've also created #132653 to update the formula (with you as co-author, ofc)

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


More information about the llvm-commits mailing list