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

Evan Cheng evan.cheng at apple.com
Sun Aug 2 19:23:36 PDT 2009


On Aug 2, 2009, at 12:18 PM, Jakob Stoklund Olesen wrote:

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

I am confused. Is BITTGL a two-address instruction? Is MOVENCC_z the  
copy instruction? If so, then this is perfectly legal.

Evan

>
> /jakob
>
> _______________________________________________
> 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