mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 23:31:37 +00:00
Remove LiveIntervals::trackingRegUnits().
With regunit liveness permanently enabled, this function would always return true. Also remove now obsolete code for checking physreg interference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159006 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7ee3ca10f5
commit
241d0209a7
@ -347,11 +347,6 @@ namespace llvm {
|
||||
return RegUnitIntervals[Unit];
|
||||
}
|
||||
|
||||
/// trackingRegUnits - Does LiveIntervals curently track register units?
|
||||
/// This function will be removed when regunit tracking is permanently
|
||||
/// enabled.
|
||||
bool trackingRegUnits() const { return !RegUnitIntervals.empty(); }
|
||||
|
||||
private:
|
||||
/// computeIntervals - Compute live intervals.
|
||||
void computeIntervals();
|
||||
|
@ -1188,7 +1188,7 @@ private:
|
||||
|
||||
// Collect ranges for register units. These live ranges are computed on
|
||||
// demand, so just skip any that haven't been computed yet.
|
||||
if (TargetRegisterInfo::isPhysicalRegister(Reg) && LIS.trackingRegUnits())
|
||||
if (TargetRegisterInfo::isPhysicalRegister(Reg))
|
||||
for (MCRegUnitIterator Units(Reg, &TRI); Units.isValid(); ++Units)
|
||||
if (LiveInterval *LI = LIS.getCachedRegUnit(*Units))
|
||||
collectRanges(MO, LI, Entering, Internal, Exiting, OldIdx);
|
||||
|
@ -236,64 +236,20 @@ std::auto_ptr<PBQPRAProblem> PBQPBuilder::build(MachineFunction *mf,
|
||||
continue;
|
||||
|
||||
// vregLI overlaps fixed regunit interference.
|
||||
if (LIS->trackingRegUnits()) {
|
||||
bool Interference = false;
|
||||
for (MCRegUnitIterator Units(preg, tri); Units.isValid(); ++Units) {
|
||||
if (vregLI->overlaps(LIS->getRegUnit(*Units))) {
|
||||
Interference = true;
|
||||
break;
|
||||
}
|
||||
bool Interference = false;
|
||||
for (MCRegUnitIterator Units(preg, tri); Units.isValid(); ++Units) {
|
||||
if (vregLI->overlaps(LIS->getRegUnit(*Units))) {
|
||||
Interference = true;
|
||||
break;
|
||||
}
|
||||
if (Interference)
|
||||
continue;
|
||||
}
|
||||
if (Interference)
|
||||
continue;
|
||||
|
||||
// preg is usable for this virtual register.
|
||||
vrAllowed.push_back(preg);
|
||||
}
|
||||
|
||||
RegSet overlappingPRegs;
|
||||
|
||||
// Record physical registers whose ranges overlap.
|
||||
for (RegSet::const_iterator pregItr = pregs.begin(),
|
||||
pregEnd = pregs.end();
|
||||
pregItr != pregEnd; ++pregItr) {
|
||||
unsigned preg = *pregItr;
|
||||
if (!LIS->hasInterval(preg))
|
||||
continue;
|
||||
const LiveInterval *pregLI = &LIS->getInterval(preg);
|
||||
|
||||
if (pregLI->empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (vregLI->overlaps(*pregLI))
|
||||
overlappingPRegs.insert(preg);
|
||||
}
|
||||
|
||||
for (RegSet::const_iterator pregItr = overlappingPRegs.begin(),
|
||||
pregEnd = overlappingPRegs.end();
|
||||
pregItr != pregEnd; ++pregItr) {
|
||||
unsigned preg = *pregItr;
|
||||
|
||||
// Remove the register from the allowed set.
|
||||
VRAllowed::iterator eraseItr =
|
||||
std::find(vrAllowed.begin(), vrAllowed.end(), preg);
|
||||
|
||||
if (eraseItr != vrAllowed.end()) {
|
||||
vrAllowed.erase(eraseItr);
|
||||
}
|
||||
|
||||
// Also remove any aliases.
|
||||
for (MCRegAliasIterator AI(preg, tri, false); AI.isValid(); ++AI) {
|
||||
VRAllowed::iterator eraseItr =
|
||||
std::find(vrAllowed.begin(), vrAllowed.end(), *AI);
|
||||
if (eraseItr != vrAllowed.end()) {
|
||||
vrAllowed.erase(eraseItr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Construct the node.
|
||||
PBQP::Graph::NodeItr node =
|
||||
g.addNode(PBQP::Vector(vrAllowed.size() + 1, 0));
|
||||
|
@ -1100,26 +1100,12 @@ bool RegisterCoalescer::joinReservedPhysReg(CoalescerPair &CP) {
|
||||
|
||||
// Deny any overlapping intervals. This depends on all the reserved
|
||||
// register live ranges to look like dead defs.
|
||||
if (LIS->trackingRegUnits()) {
|
||||
for (MCRegUnitIterator UI(CP.getDstReg(), TRI); UI.isValid(); ++UI)
|
||||
if (RHS.overlaps(LIS->getRegUnit(*UI))) {
|
||||
DEBUG(dbgs() << "\t\tInterference: " << PrintRegUnit(*UI, TRI) << '\n');
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
for (MCRegAliasIterator AS(CP.getDstReg(), TRI, true); AS.isValid(); ++AS) {
|
||||
if (!LIS->hasInterval(*AS)) {
|
||||
// Make sure at least DstReg itself exists before attempting a join.
|
||||
if (*AS == CP.getDstReg())
|
||||
LIS->getOrCreateInterval(CP.getDstReg());
|
||||
continue;
|
||||
}
|
||||
if (RHS.overlaps(LIS->getInterval(*AS))) {
|
||||
DEBUG(dbgs() << "\t\tInterference: " << PrintReg(*AS, TRI) << '\n');
|
||||
return false;
|
||||
}
|
||||
for (MCRegUnitIterator UI(CP.getDstReg(), TRI); UI.isValid(); ++UI)
|
||||
if (RHS.overlaps(LIS->getRegUnit(*UI))) {
|
||||
DEBUG(dbgs() << "\t\tInterference: " << PrintRegUnit(*UI, TRI) << '\n');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Skip any value computations, we are not adding new values to the
|
||||
// reserved register. Also skip merging the live ranges, the reserved
|
||||
// register live range doesn't need to be accurate as long as all the
|
||||
|
Loading…
x
Reference in New Issue
Block a user