summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SplitKit.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-10 17:07:22 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-10 17:07:22 +0000
commit284c2dbfd7a64e7399bb4e76cf2c63eb260e5bdc (patch)
tree6a3b8d985fc0d4137138c91728ca50e1716a1ec8 /llvm/lib/CodeGen/SplitKit.cpp
parent5730846c2fd288dcf3e2c60328b2886bdfeb69ba (diff)
Recalculate the spill weight and allocation hint for virtual registers created
during live range splitting. llvm-svn: 110686
Diffstat (limited to 'llvm/lib/CodeGen/SplitKit.cpp')
-rw-r--r--llvm/lib/CodeGen/SplitKit.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp
index e6a7b70c7d63..b7af73f627ab 100644
--- a/llvm/lib/CodeGen/SplitKit.cpp
+++ b/llvm/lib/CodeGen/SplitKit.cpp
@@ -15,6 +15,7 @@
#define DEBUG_TYPE "splitter"
#include "SplitKit.h"
#include "VirtRegMap.h"
+#include "llvm/CodeGen/CalcSpillWeights.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
@@ -566,8 +567,12 @@ void SplitEditor::rewrite() {
intervals_.push_back(dupli_);
}
- // FIXME: *Calculate spill weights, allocation hints, and register classes for
- // firstInterval..
+ // Calculate spill weight and allocation hints for new intervals.
+ VirtRegAuxInfo vrai(vrm_.getMachineFunction(), lis_, sa_.loops_);
+ for (unsigned i = firstInterval, e = intervals_.size(); i != e; ++i) {
+ LiveInterval &li = *intervals_[i];
+ vrai.CalculateWeightAndHint(li);
+ }
}