[llvm-commits] [llvm] r112741 - /llvm/trunk/lib/CodeGen/RegAllocLinearScan.cpp

Jim Grosbach grosbach at apple.com
Wed Sep 1 14:23:35 PDT 2010


On Sep 1, 2010, at 2:20 PM, Jakob Stoklund Olesen wrote:

> 
> On Sep 1, 2010, at 2:04 PM, Jim Grosbach wrote:
> 
>> +    if (!physReg) {
>> +      TargetRegisterClass::iterator aoe = RC->allocation_order_end(*mf_);
>> +      TargetRegisterClass::iterator i = RC->allocation_order_begin(*mf_);
>> +      while (reservedRegs_.test(*i) && i != aoe)
>> +        ++i;
>> +      assert(i != aoe && "All registers reserved?!");
>> +      physReg = *i;
>> +    }
> 
> Hi Jim,
> 
> This bit should probably be a function since you're doing it twice.
> 
> Also, make sure you can handle register classes with an empty allocation order. They shouldn't occur here, but its better to get the assert when they do.
> 

Both excellent points. Will do.

> I would like to properly clean up the specification of allocation order, register classes, and reserved registers in the .td files, but for now allowing reserved registers in the allocation order is a good compromise.

Agreed. There's definitely lots of room for improvement in this area.

Thanks for the review!

-Jim



More information about the llvm-commits mailing list