summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-10 00:02:26 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-08-10 00:02:26 +0000
commite00c49da11a8b7b0edb825d62a330120178fa390 (patch)
treee51238464ea70927e1fb8697288cd25e396d5bcf /llvm/lib/CodeGen/LiveInterval.cpp
parent001d6fa174dd1647638335df07eb1d1d31dfae30 (diff)
downloadbcm5719-llvm-e00c49da11a8b7b0edb825d62a330120178fa390.tar.gz
bcm5719-llvm-e00c49da11a8b7b0edb825d62a330120178fa390.zip
Transpose the calculation of spill weights such that we are calculating one
register at a time. This turns out to be slightly faster than iterating over instructions, but more importantly, it allows us to compute spill weights for new registers created after the spill weight pass has run. Also compute the allocation hint at the same time as the spill weight. This allows us to use the spill weight as a cost metric for copies, and choose the most profitable hint if there is more than one possibility. The new hints provide a very small (< 0.1%) but universal code size improvement. llvm-svn: 110631
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveInterval.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index f4c06b203cb..6820a615e8d 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/lib/CodeGen/LiveInterval.cpp
@@ -515,18 +515,6 @@ void LiveInterval::join(LiveInterval &Other,
}
ComputeJoinedWeight(Other);
-
- // Update regalloc hint if currently there isn't one.
- if (TargetRegisterInfo::isVirtualRegister(reg) &&
- TargetRegisterInfo::isVirtualRegister(Other.reg)) {
- std::pair<unsigned, unsigned> Hint = MRI->getRegAllocationHint(reg);
- if (Hint.first == 0 && Hint.second == 0) {
- std::pair<unsigned, unsigned> OtherHint =
- MRI->getRegAllocationHint(Other.reg);
- if (OtherHint.first || OtherHint.second)
- MRI->setRegAllocationHint(reg, OtherHint.first, OtherHint.second);
- }
- }
}
/// MergeRangesInAsValue - Merge all of the intervals in RHS into this live
OpenPOWER on IntegriCloud