summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalUnion.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-08 20:46:18 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-08 20:46:18 +0000
commit4931bbc671cac2d902bb72ffecc2bb80f63ec457 (patch)
tree121b9917bc33065d8088b56b6203fb2c2d12adca /llvm/lib/CodeGen/LiveIntervalUnion.cpp
parent204c128f666e0a65818ea842c5a0b7b29c548f59 (diff)
downloadbcm5719-llvm-4931bbc671cac2d902bb72ffecc2bb80f63ec457.tar.gz
bcm5719-llvm-4931bbc671cac2d902bb72ffecc2bb80f63ec457.zip
Be more aggressive about following hints.
RAGreedy::tryAssign will now evict interference from the preferred register even when another register is free. To support this, add the EvictionCost struct that counts how many hints are broken by an eviction. We don't want to break one hint just to satisfy another. Rename canEvict to shouldEvict, and add the first bit of eviction policy that doesn't depend on spill weights: Always make room in the preferred register as long as the evictees can be split and aren't already assigned to their preferred register. Also make the CSR avoidance more accurate. When looking for a cheaper register it is OK to use a new volatile register. Only CSR aliases that have never been used before should be avoided. llvm-svn: 134735
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalUnion.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalUnion.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalUnion.cpp b/llvm/lib/CodeGen/LiveIntervalUnion.cpp
index b67f96667bf..70003e7cc86 100644
--- a/llvm/lib/CodeGen/LiveIntervalUnion.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalUnion.cpp
@@ -244,7 +244,7 @@ bool LiveIntervalUnion::Query::isSeenInterference(LiveInterval *VirtReg) const {
//
// For comments on how to speed it up, see Query::findIntersection().
unsigned LiveIntervalUnion::Query::
-collectInterferingVRegs(unsigned MaxInterferingRegs, float MaxWeight) {
+collectInterferingVRegs(unsigned MaxInterferingRegs) {
InterferenceResult IR = firstInterference();
LiveInterval::iterator VirtRegEnd = VirtReg->end();
LiveInterval *RecentInterferingVReg = NULL;
@@ -287,10 +287,6 @@ collectInterferingVRegs(unsigned MaxInterferingRegs, float MaxWeight) {
RecentInterferingVReg = IR.LiveUnionI.value();
++IR.LiveUnionI;
- // Stop collecting when the max weight is exceeded.
- if (RecentInterferingVReg->weight >= MaxWeight)
- return InterferingVRegs.size();
-
continue;
}
// VirtRegI may have advanced far beyond LiveUnionI,
OpenPOWER on IntegriCloud