summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegisterPressure.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/RegisterPressure.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterPressure.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/RegisterPressure.cpp b/llvm/lib/CodeGen/RegisterPressure.cpp
index 8382b0912bd..3749b1dd217 100644
--- a/llvm/lib/CodeGen/RegisterPressure.cpp
+++ b/llvm/lib/CodeGen/RegisterPressure.cpp
@@ -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]);
}
}
}
OpenPOWER on IntegriCloud