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

Jakob Stoklund Olesen stoklund at 2pi.dk
Sun Aug 2 08:07:30 PDT 2009


Hi,

Blackfin has a rather weird register class used to represent a SETCC  
result. It sometimes takes two instructions to copy from this class to  
a normal GPR:

%reg1031<def> = SETEQri_not %reg1029<kill>, 4294967295
%R0<def> = MOVENCC_z %reg1031<kill>
%R0<def> = BITTGL %R0<kill>, 0
RTS %R0<imp-use,kill>, %RETS<imp-use>

The two middle instructions copy %reg1031 to the return value register  
%R0. They were inserted by BlackfinInstrInfo::copyRegToReg().

Note the kill flag on BITTGL %R0<kill>. It was added by  
LiveVariables::HandlePhysRegKill(). It is not supposed to be there  
because BITTGL is a two-address instruction.

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.

/jakob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: two-addr-kill.patch
Type: application/octet-stream
Size: 785 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090802/bcc56e13/attachment.obj>
-------------- next part --------------



More information about the llvm-commits mailing list