diff options
author | Evan Cheng <evan.cheng@apple.com> | 2012-03-09 00:24:29 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2012-03-09 00:24:29 +0000 |
commit | bc3b4e3f123403fb91d33293d1a5984d9585e4a7 (patch) | |
tree | 1d00d6d01a3e85d09d099d07cf2568d1210aa564 /llvm/lib | |
parent | 398ecd6200d898e082e4efe965f3aa3eb5a2e14f (diff) | |
download | bcm5719-llvm-bc3b4e3f123403fb91d33293d1a5984d9585e4a7.tar.gz bcm5719-llvm-bc3b4e3f123403fb91d33293d1a5984d9585e4a7.zip |
Cache MBB->begin. It's possible the scheduler / bundler may change MBB->begin().
llvm-svn: 152356
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/MachineScheduler.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp index 203ddfd18bc..80862157cc4 100644 --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -128,13 +128,13 @@ bool MachineScheduler::runOnMachineFunction(MachineFunction &mf) { // Break the block into scheduling regions [I, RegionEnd), and schedule each // region as soon as it is discovered. unsigned RemainingCount = MBB->size(); - for(MachineBasicBlock::iterator RegionEnd = MBB->end(); - RegionEnd != MBB->begin();) { + for(MachineBasicBlock::iterator RegionEnd = MBB->end(), + RegionStart = MBB->begin(); RegionEnd != RegionStart;) { Scheduler->startBlock(MBB); // The next region starts above the previous region. Look backward in the // instruction stream until we find the nearest boundary. MachineBasicBlock::iterator I = RegionEnd; - for(;I != MBB->begin(); --I, --RemainingCount) { + for(;I != RegionStart; --I, --RemainingCount) { if (TII->isSchedulingBoundary(llvm::prior(I), MBB, *MF)) break; } |