aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineLICM.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2011-12-22 02:13:25 +0000
committerPete Cooper <peter_cooper@apple.com>2011-12-22 02:13:25 +0000
commit3cfecf5cc2279cbbcdd497f2898161e40e690c86 (patch)
treef7d93e8d5e1ca508b891382c322610860433bc71 /lib/CodeGen/MachineLICM.cpp
parentdcc557f1463107d0f2f6b0099c99593b8fce4e36 (diff)
downloadexternal_llvm-3cfecf5cc2279cbbcdd497f2898161e40e690c86.zip
external_llvm-3cfecf5cc2279cbbcdd497f2898161e40e690c86.tar.gz
external_llvm-3cfecf5cc2279cbbcdd497f2898161e40e690c86.tar.bz2
Hoisted some loop invariant smallvector lookups out of a MachineLICM loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147127 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineLICM.cpp')
-rw-r--r--lib/CodeGen/MachineLICM.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp
index 3a82700..6854838 100644
--- a/lib/CodeGen/MachineLICM.cpp
+++ b/lib/CodeGen/MachineLICM.cpp
@@ -1036,9 +1036,11 @@ bool MachineLICM::CanCauseHighRegPressure(DenseMap<unsigned, int> &Cost) {
continue;
unsigned RCId = CI->first;
+ unsigned Limit = RegLimit[RCId];
+ int Cost = CI->second;
for (unsigned i = BackTrace.size(); i != 0; --i) {
SmallVector<unsigned, 8> &RP = BackTrace[i-1];
- if (RP[RCId] + CI->second >= RegLimit[RCId])
+ if (RP[RCId] + Cost >= Limit)
return true;
}
}