mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
MI Sched: Track live-thru registers.
When registers must be live throughout the scheduling region, increase the limit for the register class. Once we exceed the original limit, they will be spilled, and there's no point further reducing pressure. This isn't a perfect heuristics but avoids a situation where the scheduler could become trapped by trying to achieve the impossible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187436 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -464,7 +464,7 @@ void ScheduleDAGMI::initRegPressure() {
|
||||
// Close the RPTracker to finalize live ins.
|
||||
RPTracker.closeRegion();
|
||||
|
||||
DEBUG(RPTracker.getPressure().dump(TRI));
|
||||
DEBUG(RPTracker.dump());
|
||||
|
||||
// Initialize the live ins and live outs.
|
||||
TopRPTracker.addLiveRegs(RPTracker.getPressure().LiveInRegs);
|
||||
@ -476,6 +476,13 @@ void ScheduleDAGMI::initRegPressure() {
|
||||
TopRPTracker.closeTop();
|
||||
BotRPTracker.closeBottom();
|
||||
|
||||
BotRPTracker.initLiveThru(RPTracker);
|
||||
if (!BotRPTracker.getLiveThru().empty()) {
|
||||
TopRPTracker.initLiveThru(BotRPTracker.getLiveThru());
|
||||
DEBUG(dbgs() << "Live Thru: ";
|
||||
dumpRegSetPressure(BotRPTracker.getLiveThru(), TRI));
|
||||
};
|
||||
|
||||
// Account for liveness generated by the region boundary.
|
||||
if (LiveRegionEnd != RegionEnd)
|
||||
BotRPTracker.recede();
|
||||
@ -579,7 +586,8 @@ void ScheduleDAGMI::schedule() {
|
||||
/// Build the DAG and setup three register pressure trackers.
|
||||
void ScheduleDAGMI::buildDAGWithRegPressure() {
|
||||
// Initialize the register pressure tracker used by buildSchedGraph.
|
||||
RPTracker.init(&MF, RegClassInfo, LIS, BB, LiveRegionEnd);
|
||||
RPTracker.init(&MF, RegClassInfo, LIS, BB, LiveRegionEnd,
|
||||
/*TrackUntiedDefs=*/true);
|
||||
|
||||
// Account for liveness generate by the region boundary.
|
||||
if (LiveRegionEnd != RegionEnd)
|
||||
|
Reference in New Issue
Block a user