[llvm-commits] [llvm] r134123 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp

Eric Christopher echristo at apple.com
Wed Jun 29 18:36:35 PDT 2011


On Jun 29, 2011, at 6:33 PM, Jakob Stoklund Olesen wrote:

> 
> On Jun 29, 2011, at 6:20 PM, Eric Christopher wrote:
> 
>> -static const TargetRegisterClass *
>> -isAllocatableRegister(unsigned Reg, MachineFunction &MF,
>> -                      const TargetLowering &TLI,
>> -                      const TargetRegisterInfo *TRI) {
> ...
>> -  for (TargetRegisterInfo::regclass_iterator RCI = TRI->regclass_begin(),
>> -       E = TRI->regclass_end(); RCI != E; ++RCI) {
> ...
>> -    for (TargetRegisterClass::vt_iterator I = RC->vt_begin(), E = RC->vt_end();
>> -         I != E; ++I) {
>> -      if (TLI.isTypeLegal(*I)) {
>> -        // If we have already found this register in a different register class,
>> -        // choose the one with the largest VT specified.  For example, on
>> -        // PowerPC, we favor f64 register classes over f32.
>> -        if (FoundVT == MVT::Other || FoundVT.bitsLT(*I)) {
> 
> Awesome! That function was particularly special.

It was. I'd never really seen it before just now and it scared me. :)

-eric



More information about the llvm-commits mailing list