[LLVMdev] Live Intervals Question

Evan Cheng evan.cheng at apple.com
Tue Jun 26 19:12:01 PDT 2007


On Jun 26, 2007, at 5:33 PM, David A. Greene wrote:

> On Tuesday 26 June 2007 14:57, David Greene wrote:
>
>>> EAX and its sub-registers are defined by the MOV8rr instruction
>>>
>>> implicitly:
>>>> 28	%AL<dead> = MOV8rr %reg1024<kill>, %EAX<imp-def>
>>>> MOV8rr	%mreg(2)<d>	%reg1024	%mreg(17)<d>
>>>
>>> So their live ranges start at 28+2.
>>
>> Yep, this makes sense to me.  But AL is a subregister of RAX too,
>> so shouldn't it have a live interval that starts there as well?
>
>>> 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).
>>
>> I can't quite parse that.
>>
>> 48      %EAX = MOV32rr %reg1027<kill>, %RAX<imp-use,kill>, % 
>> RAX<imp-def>
>>
>> (the implicit use of RAX makes no sense to me here)
>>
>> Any value RAX may have had was destroyed at this point.
>>
>>> Again, this is  because def of EAX r/m/w RAX.
>>
>> What does "r/m/w" mean?  "Read-modify-write?"
>
> Ah, ah, ah.  Ok, I think I see what you're getting at now.  RAX is  
> implicitly
> used by the def of EAX because part of its value still exists after  
> the
> operation.  So it's a read-modify-write of RAX.  The final value in  
> the
> 64 bit register is a combination of the upper bits of RAX and the new
> value of EAX.  So it's both an implicit use and an implicit def of  
> RAX.
>
> Is that the convention LiveIntervalAnalysis uses?

Yes.

>
> If it is, then why isn't there a similar implicit use of RAX and  
> implicit def
> of RAX at the def of AL?  And similar implicit uses and defs of AX and
> EAX (EAX is implicitly defined)?

This?
28	%AL<dead> = MOV8rr %reg1024<kill>, %EAX<imp-def>

I don't see imp-use  and imp-def of RAX. The imp-def of EAX is not  
(at least it should not) be due to def of AL. There is something else  
going on here.

Evan

>
> No matter what the convention is, it strikes me that these two cases
> (def of AL and def of EAX) should affect RAX in the same way.  They
> don't here and that seems wrong to me.
>
>                                             -Dave
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list