summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/CodeGen/CalcSpillWeights.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-01-14 19:55:43 +0000
committerpatrick <patrick@openbsd.org>2017-01-14 19:55:43 +0000
commitbd3306aecb3a15e8967143b8cdbbccf2b1b19b74 (patch)
tree309a8132b44564b9e634c0da6815187ce8eab27c /gnu/llvm/lib/CodeGen/CalcSpillWeights.cpp
parentkillp -a should not kill the window if only one pane. (diff)
downloadwireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.tar.xz
wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.zip
Import LLVM 3.9.1 including clang and lld.
Diffstat (limited to 'gnu/llvm/lib/CodeGen/CalcSpillWeights.cpp')
-rw-r--r--gnu/llvm/lib/CodeGen/CalcSpillWeights.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/gnu/llvm/lib/CodeGen/CalcSpillWeights.cpp b/gnu/llvm/lib/CodeGen/CalcSpillWeights.cpp
index 26aa46fb6c2..dc2d38a95f9 100644
--- a/gnu/llvm/lib/CodeGen/CalcSpillWeights.cpp
+++ b/gnu/llvm/lib/CodeGen/CalcSpillWeights.cpp
@@ -121,7 +121,7 @@ static bool isRematerializable(const LiveInterval &LI,
}
}
- if (!TII.isTriviallyReMaterializable(MI, LIS.getAliasAnalysis()))
+ if (!TII.isTriviallyReMaterializable(*MI, LIS.getAliasAnalysis()))
return false;
}
return true;
@@ -170,8 +170,7 @@ VirtRegAuxInfo::calculateSpillWeightAndHint(LiveInterval &li) {
// Calculate instr weight.
bool reads, writes;
std::tie(reads, writes) = mi->readsWritesVirtualRegister(li.reg);
- weight = LiveIntervals::getSpillWeight(
- writes, reads, &MBFI, mi);
+ weight = LiveIntervals::getSpillWeight(writes, reads, &MBFI, *mi);
// Give extra weight to what looks like a loop induction variable update.
if (writes && isExiting && LIS.isLiveOutOfMBB(li, mbb))
@@ -192,11 +191,15 @@ VirtRegAuxInfo::calculateSpillWeightAndHint(LiveInterval &li) {
// FIXME: we probably shouldn't use floats at all.
volatile float hweight = Hint[hint] += weight;
if (TargetRegisterInfo::isPhysicalRegister(hint)) {
- if (hweight > bestPhys && mri.isAllocatable(hint))
- bestPhys = hweight, hintPhys = hint;
+ if (hweight > bestPhys && mri.isAllocatable(hint)) {
+ bestPhys = hweight;
+ hintPhys = hint;
+ }
} else {
- if (hweight > bestVirt)
- bestVirt = hweight, hintVirt = hint;
+ if (hweight > bestVirt) {
+ bestVirt = hweight;
+ hintVirt = hint;
+ }
}
}