[PATCH] D86177: [llvm-mca][NFC] Separate calculation of display data from its display in the summary and instruction info views

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 13:56:21 PDT 2020


lebedev.ri added inline comments.


================
Comment at: llvm/tools/llvm-mca/Views/InstructionInfoView.cpp:43-44
 
-  for (unsigned I = 0, E = Source.size(); I < E; ++I) {
-    const MCInst &Inst = Source[I];
-    const MCInstrDesc &MCDesc = MCII.get(Inst.getOpcode());
-
-    // Obtain the scheduling class information from the instruction.
-    unsigned SchedClassID = MCDesc.getSchedClass();
-    unsigned CPUID = SM.getProcessorID();
-
-    // Try to solve variant scheduling classes.
-    while (SchedClassID && SM.getSchedClassDesc(SchedClassID)->isVariant())
-      SchedClassID = STI.resolveVariantSchedClass(SchedClassID, &Inst, CPUID);
-
-    const MCSchedClassDesc &SCDesc = *SM.getSchedClassDesc(SchedClassID);
-    unsigned NumMicroOpcodes = SCDesc.NumMicroOps;
-    unsigned Latency = MCSchedModel::computeInstrLatency(STI, SCDesc);
-    // Add extra latency due to delays in the forwarding data paths.
-    Latency += MCSchedModel::getForwardingDelayCycles(
-        STI.getReadAdvanceEntries(SCDesc));
-    Optional<double> RThroughput =
-        MCSchedModel::getReciprocalThroughput(STI, SCDesc);
+  int Ix = 0;
+  for (auto I : zip(IIVD, Source)) {
+    const InstructionInfoViewData &IIVDEntry = std::get<0>(I);
----------------
Ok, then

auto I : enumerate(zip(IIVD, Source))
const InstructionInfoViewData &IIVDEntry = std::get<0>(I.value());
CE.getEncoding(I.index())


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86177/new/

https://reviews.llvm.org/D86177



More information about the llvm-commits mailing list