mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
Simplify RegAllocGreedy's use of register aliases.
llvm-svn: 121807
This commit is contained in:
parent
7ee6f83da1
commit
48800c9689
@ -154,11 +154,8 @@ float RAGreedy::getPriority(LiveInterval *LI) {
|
||||
// Check interference without using the cache.
|
||||
bool RAGreedy::checkUncachedInterference(LiveInterval &VirtReg,
|
||||
unsigned PhysReg) {
|
||||
LiveIntervalUnion::Query subQ(&VirtReg, &PhysReg2LiveUnion[PhysReg]);
|
||||
if (subQ.checkInterference())
|
||||
return true;
|
||||
for (const unsigned *AliasI = TRI->getAliasSet(PhysReg); *AliasI; ++AliasI) {
|
||||
subQ.init(&VirtReg, &PhysReg2LiveUnion[*AliasI]);
|
||||
for (const unsigned *AliasI = TRI->getOverlaps(PhysReg); *AliasI; ++AliasI) {
|
||||
LiveIntervalUnion::Query subQ(&VirtReg, &PhysReg2LiveUnion[*AliasI]);
|
||||
if (subQ.checkInterference())
|
||||
return true;
|
||||
}
|
||||
@ -170,19 +167,9 @@ bool RAGreedy::checkUncachedInterference(LiveInterval &VirtReg,
|
||||
/// interfering.
|
||||
LiveInterval *RAGreedy::getSingleInterference(LiveInterval &VirtReg,
|
||||
unsigned PhysReg) {
|
||||
// Check physreg and aliases.
|
||||
LiveInterval *Interference = 0;
|
||||
|
||||
// Check direct interferences.
|
||||
LiveIntervalUnion::Query &Q = query(VirtReg, PhysReg);
|
||||
if (Q.checkInterference()) {
|
||||
Q.collectInterferingVRegs(1);
|
||||
if (!Q.seenAllInterferences())
|
||||
return 0;
|
||||
Interference = Q.interferingVRegs().front();
|
||||
}
|
||||
|
||||
// Check aliases.
|
||||
for (const unsigned *AliasI = TRI->getAliasSet(PhysReg); *AliasI; ++AliasI) {
|
||||
for (const unsigned *AliasI = TRI->getOverlaps(PhysReg); *AliasI; ++AliasI) {
|
||||
LiveIntervalUnion::Query &Q = query(VirtReg, *AliasI);
|
||||
if (Q.checkInterference()) {
|
||||
if (Interference)
|
||||
|
Loading…
Reference in New Issue
Block a user