[llvm-commits] [llvm] r152356 - /llvm/trunk/lib/CodeGen/MachineScheduler.cpp

Chad Rosier mcrosier at apple.com
Thu Mar 8 17:04:55 PST 2012


On Mar 8, 2012, at 4:24 PM, Evan Cheng wrote:

> Author: evancheng
> Date: Thu Mar  8 18:24:29 2012
> New Revision: 152356
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=152356&view=rev
> Log:
> Cache MBB->begin. It's possible the scheduler / bundler may change MBB->begin().

The change implies the scheduler / bundler will _not_ changed MBB->being(), right?

 Chad

> Modified:
>    llvm/trunk/lib/CodeGen/MachineScheduler.cpp
> 
> Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=152356&r1=152355&r2=152356&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Thu Mar  8 18:24:29 2012
> @@ -128,13 +128,13 @@
>     // 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;
>       }
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list