[LLVMdev] Kill-flag in two-address instruction tied operands
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Jul 14 12:10:36 PDT 2009
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
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
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,
Case c: <kill> is don't care. Fix regscavenger.
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).
More information about the llvm-dev