[llvm-commits] [llvm] r126190 - in /llvm/trunk: lib/CodeGen/VirtRegRewriter.cpp test/CodeGen/X86/2011-02-21-VirtRegRewriter-KillSubReg.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Feb 22 08:04:29 PST 2011


On Feb 21, 2011, at 11:58 PM, Evan Cheng wrote:

> 
> On Feb 21, 2011, at 11:37 PM, Andrew Trick wrote:
> 
>>>> Apparently it's ok for multiple operands to "kill" the same register.
>>> 
>>> It is?
>>> 
>>> Evan
>> 
>> Prior to the standard spiller, we have:
>>   MOV8mr %vreg34<kill>, 1, %noreg, 3, %noreg, %vreg34:sub_8bit<kill>; mem:ST1[%arrayidx833] GR32_ABCD:%vreg34
>> 
>> Before rewriting we have:
>>   %EAX<def> = MOV32rm <fi#0>, 1, %noreg, 0, %noreg; mem:LD4[FixedStack0]
>>   MOV8mr %EAX<kill>, 1, %noreg, 3, %noreg, %AL<kill>; mem:ST1[%arrayidx833]
> 
> The *right* representation is for EAX being the only kill. But I agree it's hard to eliminate the extra kill.

The machine code verifier also accepts the second kill flag as optional.

If we want a stricter format, we should perhaps consider requiring all operands to have kill flags. That way, you can tell from any operand if its instruction kills the register.

/jakob






More information about the llvm-commits mailing list