aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2014-10-10 17:06:20 +0000
committerHal Finkel <hfinkel@anl.gov>2014-10-10 17:06:20 +0000
commit7a87f8a6700c2184254eb2e8d8c9048975ad3b62 (patch)
tree69735d86525c97b17f1aed81506740d997c0a1dd /llvm/lib/CodeGen/MachineScheduler.cpp
parent12f9488e3375e5254226befb423b888b65410ee0 (diff)
downloadllvm-7a87f8a6700c2184254eb2e8d8c9048975ad3b62.zip
llvm-7a87f8a6700c2184254eb2e8d8c9048975ad3b62.tar.gz
llvm-7a87f8a6700c2184254eb2e8d8c9048975ad3b62.tar.bz2
[MiSched] Fix a logic error in tryPressure()
Fixes a logic error in the MachineScheduler found by Steve Montgomery (and confirmed by Andy). This has gone unfixed for months because the fix has been found to introduce some small performance regressions. However, Andy has recommended that, at this point, we fix this to avoid further dependence on the incorrect behavior (and then follow-up separately on any regressions), and I agree. Fixes PR18883. llvm-svn: 219512
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 7e3c33b..b140fc6 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -2495,8 +2495,8 @@ static bool tryPressure(const PressureChange &TryP,
}
// If one candidate decreases and the other increases, go with it.
// Invalid candidates have UnitInc==0.
- if (tryLess(TryP.getUnitInc() < 0, CandP.getUnitInc() < 0, TryCand, Cand,
- Reason)) {
+ if (tryGreater(TryP.getUnitInc() < 0, CandP.getUnitInc() < 0, TryCand, Cand,
+ Reason)) {
return true;
}
// If the candidates are decreasing pressure, reverse priority.