[SystemZ] NFC: Remove redundant check in SystemZHazardRecognizer.
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 7 Aug 2018 13:44:11 +0000 (13:44 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 7 Aug 2018 13:44:11 +0000 (13:44 +0000)
Remove the redundant check against zero when updating ProcResourceCounters in
nextGroup(), as pointed out in https://reviews.llvm.org/D50187.

Review: Ulrich Weigand.
llvm-svn: 339139

llvm/lib/Target/SystemZ/SystemZHazardRecognizer.cpp

index 2e3e56280f9dd00fd34d51efd2f3cd03a029e56b..09ea018b2d6e0a648d1290a44e7a937a5a3784bf 100644 (file)
@@ -151,10 +151,9 @@ void SystemZHazardRecognizer::nextGroup() {
 
   // Decrease counters for execution units by one.
   for (unsigned i = 0; i < SchedModel->getNumProcResourceKinds(); ++i)
-    if (ProcResourceCounters[i] > 0)
-      ProcResourceCounters[i] =
-        ((ProcResourceCounters[i] > NumGroups) ?
-         (ProcResourceCounters[i] - NumGroups) : 0);
+    ProcResourceCounters[i] = ((ProcResourceCounters[i] > NumGroups)
+                                   ? (ProcResourceCounters[i] - NumGroups)
+                                   : 0);
 
   // Clear CriticalResourceIdx if it is now below the threshold.
   if (CriticalResourceIdx != UINT_MAX &&