[llvm-commits] [PATCH] Accidental <kill> on two-address operand

Jakob Stoklund Olesen stoklund at 2pi.dk
Sun Aug 2 12:18:30 PDT 2009


On 02/08/2009, at 20.58, Evan Cheng wrote:

>
> On Aug 2, 2009, at 8:07 AM, Jakob Stoklund Olesen wrote:
>> The attached patch fixes this by refusing to add the kill flag in
>> MachineInstr::addRegisterKilled(). I am not sure if that is the
>> correct place to handle this issue, but it fixes three of my
>> blackfin test cases.
>
> Ok. I would have preferred if LiveVariables::HandlePhysRegKill() just
> doesn't call MachineInstr::addRegisterKilled() in this case. But
> that'll probably hurt compile time. I am ok with this patch. Thanks.

Committed: http://llvm.org/viewvc/llvm-project?rev=77906&view=rev

Note that MachineInstr::addRegisterKilled() is also called from  
LowerSubregs without regard for two-address instructions, so special  
handling would be needed there as well.

On a related note: My two-instr copy creates non-SSA machine code when  
asked to copy between two virtual registers. Is that OK? Do I have to  
create a new virtual register in that case?

The generated code looks like this:

%reg1032<def> = MOVENCC_z %reg1031<kill>
%reg1032<def> = BITTGL %reg1032, 0

In this case a kill flag is also added to BITTGL, and  
TwoAddressInstructionPass fails to remove it again. Probably because  
it is expecting SSA code as input?

/jakob




More information about the llvm-commits mailing list