aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocBasic.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-14 23:10:48 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-14 23:10:48 +0000
commit16999da951677a94a2f30d98c8126ff175f457e1 (patch)
treec1ebc0e01c223be59f12552cb47676ffd56d4165 /lib/CodeGen/RegAllocBasic.cpp
parentb83ff84193d44bb9aa75e1264ffaff55f468a303 (diff)
Simplyfy RegAllocBasic by using getOverlaps instead of getAliasSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121801 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocBasic.cpp')
-rw-r--r--lib/CodeGen/RegAllocBasic.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/CodeGen/RegAllocBasic.cpp b/lib/CodeGen/RegAllocBasic.cpp
index a5e5f1f308..f01ebf5030 100644
--- a/lib/CodeGen/RegAllocBasic.cpp
+++ b/lib/CodeGen/RegAllocBasic.cpp
@@ -285,12 +285,9 @@ void RegAllocBase::allocatePhysRegs() {
// physical register. Return the interfering register.
unsigned RegAllocBase::checkPhysRegInterference(LiveInterval &VirtReg,
unsigned PhysReg) {
- if (query(VirtReg, PhysReg).checkInterference())
- return PhysReg;
- for (const unsigned *AliasI = TRI->getAliasSet(PhysReg); *AliasI; ++AliasI) {
+ for (const unsigned *AliasI = TRI->getOverlaps(PhysReg); *AliasI; ++AliasI)
if (query(VirtReg, *AliasI).checkInterference())
return *AliasI;
- }
return 0;
}
@@ -331,15 +328,9 @@ RegAllocBase::spillInterferences(LiveInterval &VirtReg, unsigned PhysReg,
SmallVectorImpl<LiveInterval*> &SplitVRegs) {
// Record each interference and determine if all are spillable before mutating
// either the union or live intervals.
-
- // Collect interferences assigned to the requested physical register.
- LiveIntervalUnion::Query &QPreg = query(VirtReg, PhysReg);
- unsigned NumInterferences = QPreg.collectInterferingVRegs();
- if (QPreg.seenUnspillableVReg()) {
- return false;
- }
+ unsigned NumInterferences = 0;
// Collect interferences assigned to any alias of the physical register.
- for (const unsigned *asI = TRI->getAliasSet(PhysReg); *asI; ++asI) {
+ for (const unsigned *asI = TRI->getOverlaps(PhysReg); *asI; ++asI) {
LiveIntervalUnion::Query &QAlias = query(VirtReg, *asI);
NumInterferences += QAlias.collectInterferingVRegs();
if (QAlias.seenUnspillableVReg()) {
@@ -351,8 +342,7 @@ RegAllocBase::spillInterferences(LiveInterval &VirtReg, unsigned PhysReg,
assert(NumInterferences > 0 && "expect interference");
// Spill each interfering vreg allocated to PhysReg or an alias.
- spillReg(VirtReg, PhysReg, SplitVRegs);
- for (const unsigned *AliasI = TRI->getAliasSet(PhysReg); *AliasI; ++AliasI)
+ for (const unsigned *AliasI = TRI->getOverlaps(PhysReg); *AliasI; ++AliasI)
spillReg(VirtReg, *AliasI, SplitVRegs);
return true;
}