[llvm-commits] [llvm] r82629 - /llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Sep 24 02:41:10 PDT 2009


Evan Cheng <evan.cheng at apple.com> writes:

> On Sep 23, 2009, at 10:41 PM, David Goodwin wrote:
>
>> Because then the superreg is never killed... I think that will cause  
>> an assertion in the following code when the superreg is defined again.
>
> That means the superreg kill should be moved down to the last use of  
> any of subreg.

This would be dangerous because sibling subregs may be used between the
superreg kill and the last subreg use.

LowerSubregs used to do it like this, and it caused some problems. Now
it uses an IMPLICIT_DEF instruction to kill the superreg. This should be
changed to a KILL instruction when that is introduced.

Example:

%AL = extract_subreg %AX<kill>, 1
%AH = mov
bar %AH<kill>
foo %AL<kill>

%AX must be killed before %AH is defined, so it is necessary to insert a
dummy instruction:

KILL %AX<kill>, %AL<imp-def>
%AH = mov
bar %AH<kill>
foo %AL<kill>

This would be illegal:

%AH = mov ; *** redefining %AH while %AX is live
bar %AH<kill>
foo %AL<kill>, %AX<imp-kill>

> My long term plan is:
> 1. Introduce "kill" pseudo instruction that terminate liveness of  
> instructions.
> 2. Move physical liveness computation out of livevariables and allow  
> codegen passes like postalloc sched to use it.

Currently physical liveness is tracked in the machine verifier, in the
register scavenger, and in the post-ra scheduler. They have subtle
differences. It would definitely be a good idea to have the rules
implemented only once.

> Note double defs is not a miscomputation. It's just a performance  
> issue. That's why I've decided to disable the assertion for now.

Right.




More information about the llvm-commits mailing list