aboutsummaryrefslogtreecommitdiffstats
path: root/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
commit1646071b23513b28e27f5029ccedd2fb1797a5e1 (patch)
tree3360bcfa05c755a40a8d29fb846c45c498ac260a /lib/CodeGen/LiveInterval.cpp
parentcc0c14c384bd71e1224c6c6d926d484d65b08e7a (diff)
downloadexternal_llvm-1646071b23513b28e27f5029ccedd2fb1797a5e1.zip
external_llvm-1646071b23513b28e27f5029ccedd2fb1797a5e1.tar.gz
external_llvm-1646071b23513b28e27f5029ccedd2fb1797a5e1.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveInterval.cpp')
-rw-r--r--lib/CodeGen/LiveInterval.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/CodeGen/LiveInterval.cpp b/lib/CodeGen/LiveInterval.cpp
index f4c06b2..6820a61 100644
--- a/lib/CodeGen/LiveInterval.cpp
+++ b/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