[LLVMdev] Live Intervals Question

Evan Cheng evan.cheng at apple.com
Tue Jun 26 12:13:35 PDT 2007


On Jun 26, 2007, at 12:11 PM, Evan Cheng wrote:


> AH,inf = [30,42:0)[50,54:1)  0@? 1@?
> AL,inf = [30,31:0)[34,42:1)[50,54:2)  0 at 30 1@? 2@?
> AX,inf = [30,42:0)[50,54:1)  0@? 1@?
> EAX,inf = [30,31:0)[34,42:1)[50,54:2)  0 at 30 1@? 2 at 50
> RAX,inf = [34,50:0)[50,54:1)  0@? 1 at 50
>
> AL is marked dead. So it makes sense there is a gap between [30:31)  
> and [34,42).  It looks like EAX implicit def should be marked dead  
> as well. So I think there is a bug there somewhere.

BTW, I am making some fixes to LiveIntervals so this may look  
different after my check-in. If it's still buggy (I expect so),  
please file a bug.  This doesn't really affect codegen but it still  
should be examined.

Evan

>
>>
>> At slot 42 all of the A registers EXCEPT RAX die (last use).   
>> Again, what's
>> the deal with RAX?  EAX is redefined just a few instructions  
>> later, which
>> should kill RAX.  The [34,50:0)[50,54:1)  interval for RAX is just  
>> weird.  Why
>> isn't it [34,54)?
>
> 48	%EAX = MOV32rr %reg1027<kill>, %RAX<imp-use,kill>, %RAX<imp-def>
> MOV32rr	%mreg(17)<d>	%reg1027	%mreg(74)	%mreg(74)<d>
>
> Def of sub-register use and define its super-register(s).  So RAX's  
> live range isn't broken here.
>
>>
>> Finally, according to the above live interval information,  
>> registers 1026 and
>> 1027 have live ranges that overlap RAX.  That's just totally bogus  
>> as can
>> be seen simply by reading the machine instructions.  EAX and all  
>> other
>> A registers are last used at instruction 40 and EAX is not defined  
>> again
>> until instruction 48, which is the last use of register 1027.  The  
>> move to
>> register 1026 is entirely unnecessary -- why is it even there?
>
> Move to r1026 is marked dead. This is the artifact of translating  
> CopyFromReg (of the call result) of EAX. It's harmless.
>
> EAX,inf = [30,31:0)[34,42:1)[50,54:2)  0 at 30 1@? 2 at 50
> RAX,inf = [34,50:0)[50,54:1)  0@? 1 at 50
> %reg1026,0 = [42,43:0)  0 at 42
> %reg1027,0 = [46,50:0)  0@?
>
> 40	%reg1026<dead> = MOV32rr %EAX<kill>
> MOV32rr	%reg1026<d>	%mreg(17)
>
> While EAX is marked kill here, RAX is still alive. Again, this is  
> because def of EAX r/m/w RAX. It does not terminate RAX live range.  
> The important thing here is reg1027 does not overlap EAX and the  
> magic of coalescer join them together.
>
> Evan
>
>
>>
>> It's apparent that I don't understand the interaction between live  
>> intervals
>> and register aliases/sub registers, etc.
>>
>> Help?
>>
>>                                                    -Dave
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070626/f15862d4/attachment.html>


More information about the llvm-dev mailing list