Index: lib/Target/AMDGPU/GCNSchedStrategy.h =================================================================== --- lib/Target/AMDGPU/GCNSchedStrategy.h +++ lib/Target/AMDGPU/GCNSchedStrategy.h @@ -75,8 +75,8 @@ unsigned Stage; // Vecor of regions recorder for later rescheduling - SmallVector, 32> Regions; + SmallVector, 32> Regions; // Region live-ins. DenseMap LiveIns; @@ -94,11 +94,6 @@ GCNScheduleDAGMILive(MachineSchedContext *C, std::unique_ptr S); - void enterRegion(MachineBasicBlock *bb, - MachineBasicBlock::iterator begin, - MachineBasicBlock::iterator end, - unsigned regioninstrs) override; - void schedule() override; void finalizeSchedule() override; Index: lib/Target/AMDGPU/GCNSchedStrategy.cpp =================================================================== --- lib/Target/AMDGPU/GCNSchedStrategy.cpp +++ lib/Target/AMDGPU/GCNSchedStrategy.cpp @@ -321,16 +321,6 @@ DEBUG(dbgs() << "Starting occupancy is " << StartingOccupancy << ".\n"); } -void GCNScheduleDAGMILive::enterRegion(MachineBasicBlock *bb, - MachineBasicBlock::iterator begin, - MachineBasicBlock::iterator end, - unsigned regioninstrs) { - ScheduleDAGMILive::enterRegion(bb, begin, end, regioninstrs); - - if (Stage == 0) - Regions.push_back(std::make_pair(begin, end)); -} - void GCNScheduleDAGMILive::schedule() { std::vector Unsched; Unsched.reserve(NumRegionInstrs); @@ -345,6 +335,9 @@ } ScheduleDAGMILive::schedule(); + if (Stage == 0) + Regions.push_back(std::make_pair(RegionBegin, RegionEnd)); + if (!LIS) return; @@ -405,6 +398,8 @@ DEBUG(dbgs() << "Scheduling " << *MI); } RegionBegin = Unsched.front()->getIterator(); + if (Stage == 0) + Regions.back() = std::make_pair(RegionBegin, RegionEnd); placeDebugValues(); }