[LLVMdev] Live Intervals Question

David A. Greene greened at obbligato.org
Tue Jun 26 17:33:23 PDT 2007


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?

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)?

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



More information about the llvm-dev mailing list