[llvm-commits] [llvm] r77989 - in /llvm/trunk: lib/CodeGen/LowerSubregs.cpp lib/CodeGen/MachineInstr.cpp test/CodeGen/ARM/2009-08-02-RegScavengerAssert-Neon.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Aug 3 23:05:26 PDT 2009


On 03/08/2009, at 23.40, Evan Cheng wrote:

>> Finally, clear the undef flag in MachineInstr::addRegisterKilled.
>> Undef implies dead and kill implies live, so they cant both be valid.
>
> That's not necessary. Undef doesn't implies dead. It just means its
> garbage and it has no liveness.

A zombie!?

I am not sure what you mean.
Do you mean that a register can have three states: dead-live-undef?
Or do you mean that an undef operand can be both dead or live, both  
are OK?

Consider this replacement in lower-subregs:

From: %R0<def> = INSERT_SUBREG %R0<undef>, %R0L<kill>, 1
To: %R0<def> = IMPLICIT_DEF %R0L<imp-use,kill>

That is what we currently do, and it works when undef implies dead. If  
undef implies "don't know", we need to do this instead:

To: %R0<def> = IMPLICIT_DEF %R0<imp-use,kill,undef>

This won't work today, because the scavenger ignores all undef  
operands, and we would get a double-def on %R0L. We could fix the  
scavenger to also kill <kill,undef> operands. But that means that  
<kill,undef> would work just like <imp-kill> did before: Kill this  
register, dead or alive.

I am not sure is RegScavenger::backward() is used today, but I think  
it can only work if we stick to strict rules. What would the state of  
%R0 be after running backward() over an IMPLICIT_DEF like the one above?

/jakob




More information about the llvm-commits mailing list