[PATCH] D34320: Use range-loop in machine-scheduler. NFCI.

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 10:29:57 PDT 2017


MatzeB added inline comments.


================
Comment at: lib/CodeGen/MachineScheduler.cpp:793
+  for (SUnit &S : SUnits) {
+    SUnit *SU = &S;
     assert(!SU->isBoundaryNode() && "Boundary node should not be in SUnits");
----------------
We already have the iteration variable, no need to keep this one around. Please rename the iteration variable to `SU` and change the users to `SU.xxx` and `&SU`.


================
Comment at: lib/CodeGen/MachineScheduler.cpp:1025
   DEBUG(dbgs() << "Excess PSets: ";
-        for (unsigned i = 0, e = RegionCriticalPSets.size(); i != e; ++i)
+        for (const auto &RCPS : RegionCriticalPSets)
           dbgs() << TRI->getRegPressureSetName(
----------------
Use `PressureChange` instead of `auto`.


================
Comment at: lib/CodeGen/MachineScheduler.cpp:1944-1945
+  for (SUnit *SU : ReadySUs) {
+//ArrayRef<SUnit*>::iterator I = ReadySUs.begin(), E = ReadySUs.end();
+ //      I != E; ++I) {
+    unsigned L = getUnscheduledLatency(SU);
----------------
Remove commented code


================
Comment at: lib/CodeGen/MachineScheduler.cpp:2956
+  for (SUnit *SU : Q) {
+//ReadyQueue::iterator I = Q.begin(), E = Q.end(); I != E; ++I) {
 
----------------
Remove commented code. There is more instances of this coming.


https://reviews.llvm.org/D34320





More information about the llvm-commits mailing list