summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CalcSpillWeights.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-02-21 13:51:43 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-02-21 13:51:43 +0000
commit3f4bde29a30d8c43db5cbe8f5541ebc5d1fdc6af (patch)
tree87140683fc3fee4e14b3c37e2aa7a4031d473f49 /lib/CodeGen/CalcSpillWeights.cpp
parenta322a4af1fe8b989fe5d1bbc15de8736a26c03ca (diff)
Vendor import of llvm release_38 branch r261369:vendor/llvm/llvm-release_38-r261369
Notes
svn path=/vendor/llvm/dist/; revision=295846 svn path=/vendor/llvm/llvm-release_38-r261369/; revision=295847; tag=vendor/llvm/llvm-release_38-r261369
Diffstat (limited to 'lib/CodeGen/CalcSpillWeights.cpp')
-rw-r--r--lib/CodeGen/CalcSpillWeights.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/CalcSpillWeights.cpp b/lib/CodeGen/CalcSpillWeights.cpp
index abc655ac34ca..26aa46fb6c2a 100644
--- a/lib/CodeGen/CalcSpillWeights.cpp
+++ b/lib/CodeGen/CalcSpillWeights.cpp
@@ -213,8 +213,11 @@ VirtRegAuxInfo::calculateSpillWeightAndHint(LiveInterval &li) {
if (!Spillable)
return;
- // Mark li as unspillable if all live ranges are tiny.
- if (li.isZeroLength(LIS.getSlotIndexes())) {
+ // Mark li as unspillable if all live ranges are tiny and the interval
+ // is not live at any reg mask. If the interval is live at a reg mask
+ // spilling may be required.
+ if (li.isZeroLength(LIS.getSlotIndexes()) &&
+ !li.isLiveAtIndexes(LIS.getRegMaskSlots())) {
li.markNotSpillable();
return;
}