[llvm-commits] [llvm] r45815 - /llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp

Owen Anderson resistor at mac.com
Wed Jan 9 20:44:35 PST 2008


You really need to address these to Evan.  I asked him what to do for  
LiveIntervalAnalysis, and this is what he told me :-)

--Owen

On Jan 9, 2008, at 10:08 PM, Chris Lattner wrote:

>> URL: http://llvm.org/viewvc/llvm-project?rev=45815&view=rev
>> Log:
>> Don't use LiveVariables::VarInfo::DefInst.
>
> Cool, question though:
>
>> +++ llvm/trunk/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Jan  9
>> 21:12:54 2008
>> @@ -309,7 +309,14 @@
>>      // are actually two values in the live interval.  Because of
>> this we
>>      // need to take the LiveRegion that defines this register and
>> split it
>>      // into two values.
>> -      unsigned DefIndex =
>> getDefIndex(getInstructionIndex(vi.DefInst));
>
> In the old code, when it introduces multiple definitions of a vreg,
> did it clear DefInst?  If so, this code can only be triggered for
> vregs with a single def.
>
>>
>> +      MachineRegisterInfo& MRI = mbb->getParent()->getRegInfo();
>
> I think that MRI should become and ivar in liveintervalanalysis.
>
>>
>> +      unsigned lowIndex = ~0U;
>> +      for (MachineRegisterInfo::def_iterator DI =
>> MRI.def_begin(interval.reg),
>> +          DE = MRI.def_end(); DI != DE; ++DI)
>> +        if (getInstructionIndex(&*DI) < lowIndex)
>> +          lowIndex = getInstructionIndex(&*DI);
>> +
>> +      unsigned DefIndex = getDefIndex(lowIndex);
>
> It would be really nice if you could drop the loop.  It's unclear why
> it's right anyway, the numbering is not necessarily contiguous across
> code...
>
> -Chris
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080109/232b130a/attachment.bin>


More information about the llvm-commits mailing list