[llvm] r339139 - [SystemZ] NFC: Remove redundant check in SystemZHazardRecognizer.

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 7 06:44:11 PDT 2018


Author: jonpa
Date: Tue Aug  7 06:44:11 2018
New Revision: 339139

URL: http://llvm.org/viewvc/llvm-project?rev=339139&view=rev
Log:
[SystemZ]  NFC: Remove redundant check in SystemZHazardRecognizer.

Remove the redundant check against zero when updating ProcResourceCounters in
nextGroup(), as pointed out in https://reviews.llvm.org/D50187.

Review: Ulrich Weigand.

Modified:
    llvm/trunk/lib/Target/SystemZ/SystemZHazardRecognizer.cpp

Modified: llvm/trunk/lib/Target/SystemZ/SystemZHazardRecognizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZHazardRecognizer.cpp?rev=339139&r1=339138&r2=339139&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZHazardRecognizer.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZHazardRecognizer.cpp Tue Aug  7 06:44:11 2018
@@ -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 &&




More information about the llvm-commits mailing list