[LLVMdev] Kill-flag in two-address instruction tied operands

Evan Cheng evan.cheng at apple.com
Tue Jul 14 17:43:26 PDT 2009


On Jul 14, 2009, at 12:10 PM, Jakob Stoklund Olesen wrote:

> Hi,
>
> Two-address instructions are represented as normal three-address
> instructions with a Desc bit that indicates the first two operands are
> tied together. The question is, should the second operand have a
> <kill> flag?
>
> a: %R0<def> = MUL %R0, %R1<kill>
> b: %R0<def> = MUL %R0<kill>, %R1<kill>
>
> I think the current policy is a: There should be no kill-flag. The

Right.

> machine code verifier has code to handle the missing <kill> flag, and
> the regscavenger asserts if the <kill> flag is set.
>
> Recently somebody (possibly myself) has been setting <kill> flags on
> my tied use operands, causing regscavenger to assert.
>
> I just want to verify the policy regarding two-address <kill> flags:
>
> Case a: <kill> is not allowed. I should add a check to the verifier
> for this. Find out who is setting the flags.
> Case b: <kill> is mandatory. Remove special-case code from verifier,
> fix regscavenger.
> Case c: <kill> is don't care. Fix regscavenger.

It's 'a'.

>
> My vote goes to b: Then you don't need special-case code for two-
> address instructions. (Except for places that need special treatment
> of two-address instrs for other reasons).

Two-address operands are being treated differently because they are  
indeed different, we are not about to change that.

Evan

>
> /jakob
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list