use std::max ; NFCI
authorSanjay Patel <spatel@rotateright.com>
Wed, 6 Jan 2016 00:36:59 +0000 (00:36 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 6 Jan 2016 00:36:59 +0000 (00:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256889 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegisterPressure.cpp

index 8382b0912bdec911083f373d5db9a7f500b45645..3749b1dd217a792673f71ce3cd95c7b24b2326d0 100644 (file)
@@ -97,9 +97,8 @@ void RegPressureTracker::increaseRegPressure(ArrayRef<unsigned> RegUnits) {
     unsigned Weight = PSetI.getWeight();
     for (; PSetI.isValid(); ++PSetI) {
       CurrSetPressure[*PSetI] += Weight;
-      if (CurrSetPressure[*PSetI] > P.MaxSetPressure[*PSetI]) {
-        P.MaxSetPressure[*PSetI] = CurrSetPressure[*PSetI];
-      }
+      P.MaxSetPressure[*PSetI] =
+          std::max(P.MaxSetPressure[*PSetI], CurrSetPressure[*PSetI]);
     }
   }
 }