[PATCH] D36696: [MachineTraceMetrics] Add computeDepth function.

Gerolf Hoflehner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 16:07:55 PDT 2017


Gerolf added a comment.

LGTM. Just some food for thought for possible follow up commits.



================
Comment at: lib/CodeGen/MachineTraceMetrics.cpp:782
+void MachineTraceMetrics::Ensemble::
+updateDepth(const MachineBasicBlock *MBB, const MachineInstr &UseMI,
+            SparseSet<LiveRegUnit> &RegUnits) {
----------------
It would make the side effects of this procedure more explicit if a reference to TBI rather than MBB is passed as the first parameter. Within MachineTraceMetrics this would also reduce the #accesss to BlockInfo.


================
Comment at: lib/CodeGen/MachineTraceMetrics.cpp:812
+
+  if (!TBI.HasValidInstrHeights) {
+    DEBUG(dbgs() << Cycle << '\t' << UseMI);
----------------
You could simplify and update the CP when HasValidInstrHeights is true.


https://reviews.llvm.org/D36696





More information about the llvm-commits mailing list