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

Evan Cheng evan.cheng at apple.com
Thu Mar 8 17:05:10 PST 2012


On Mar 8, 2012, at 5:04 PM, Chad Rosier wrote:

> 
> 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?

No it means the scheduler driver should stop when it reaches the original MBB->begin().

Evan

> 
> 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