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

Evan Cheng evan.cheng at apple.com
Sun Aug 2 11:58:20 PDT 2009


On Aug 2, 2009, at 8:07 AM, Jakob Stoklund Olesen wrote:

> 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.

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.

Evan

>
> /jakob
> <two-addr-kill.patch>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list