[llvm-commits] [llvm] r52649 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp

Owen Anderson resistor at mac.com
Mon Jun 23 23:53:32 PDT 2008


Using getMBBEndIdx() is also better for handling empty BB's as well.   
It's just general all around because using it prevents clients of LIA  
from making too many assumptions about the underlying representation.

And yes, there are many other instances of this, most within LIA  
itself.  I have out-of-tree patches that address most of them that  
will go in once we get the necessary heuristic changes done.

--Owen

On Jun 23, 2008, at 11:49 PM, Evan Cheng wrote:

> Hi Owen,
>
> What does this mean? There might be empty slots after the last
> instruction in a MBB? I am not sure that's useful. The gaps are
> generally useful for inserting instructions before existing
> instructions, not after them. Besides, I am not sure this is the only
> place that makes this assumption.
>
> Evan
>
> On Jun 23, 2008, at 3:12 PM, Owen Anderson wrote:
>
>> Author: resistor
>> Date: Mon Jun 23 17:12:23 2008
>> New Revision: 52649
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=52649&view=rev
>> Log:
>> Use getMBBEndIdx rather than assuming that the end is right after
>> the last instruction in the block.
>>
>> Modified:
>>   llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
>>
>> Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=52649&r1=52648&r2=52649&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> = 
>> =====================================================================
>> --- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon Jun 23
>> 17:12:23 2008
>> @@ -443,7 +443,7 @@
>>    LI.FindLiveRangeContaining(li_->getDefIndex(DefIdx));
>>  if (DstLR == LI.end())
>>    return false;
>> -  unsigned KillIdx = li_->getInstructionIndex(&MBB->back()) +
>> InstrSlots::NUM;
>> +  unsigned KillIdx = li_->getMBBEndIdx(MBB) + 1;
>>  if (DstLR->valno->kills.size() == 1 &&
>>      DstLR->valno->kills[0] == KillIdx && DstLR->valno->hasPHIKill)
>>    return true;
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> 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: 4260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20080623/592d7181/attachment.bin>


More information about the llvm-commits mailing list