mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
[MachineScheduler] Fix for PR21807: minor code difference building with/without -g.
This patch fixes the issue reported as PR21807. There was a minor difference in the generated code depending on the -g flag. The cause was that with -g the machine scheduler used a different scheduling strategy. This decision was based on the number of instructions in a schedule region and included debug instructions in that count. This patch fixes the issue in MISched and provides a test. Patch by Russell Gallop! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224118 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -430,9 +430,11 @@ void MachineSchedulerBase::scheduleRegions(ScheduleDAGInstrs &Scheduler) {
|
||||
// instruction stream until we find the nearest boundary.
|
||||
unsigned NumRegionInstrs = 0;
|
||||
MachineBasicBlock::iterator I = RegionEnd;
|
||||
for(;I != MBB->begin(); --I, --RemainingInstrs, ++NumRegionInstrs) {
|
||||
for(;I != MBB->begin(); --I, --RemainingInstrs) {
|
||||
if (isSchedBoundary(std::prev(I), MBB, MF, TII, IsPostRA))
|
||||
break;
|
||||
if (!I->isDebugValue())
|
||||
++NumRegionInstrs;
|
||||
}
|
||||
// Notify the scheduler of the region, even if we may skip scheduling
|
||||
// it. Perhaps it still needs to be bundled.
|
||||
|
||||
Reference in New Issue
Block a user