[llvm-dev] IsDead, IsKill

Cranmer, Joshua via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 11 11:15:57 PDT 2019


There are two concepts that may map to what you want:

1. Tied registers: you list the operand in the ins and in the outs of the Instruction in the tablegen, and then add "$rega = $regb" to the Constraints field of Instruction. This means that the register allocation must force the two registers to be the same.
2. Early clobber: you add "@earlyclobber $reg" to the Constraints field of Instruction. This tells LLVM that the output could be written to before the input is read, so the register should not allocate $reg to any of the input registers of the instruction.

-----Original Message-----
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of LLVM Mailing List via llvm-dev
Sent: Monday, March 11, 2019 13:34
To: Quentin Colombet <qcolombet at apple.com>
Cc: llvm-dev <llvm-dev at lists.llvm.org>
Subject: Re: [llvm-dev] IsDead, IsKill

Thanks.

I saw the header comments but it wasn’t clear to me what the difference between those concepts is?

My slightly vague understanding is IsDef means that the register specified by this operand is set by the machine instruction.  So I understand that to mean the MO will override that register?

Also things like early clobber, perhaps there is another document that clarifies some of these concepts?



In an example .td file that I’m looking at, how would I tell the compiler “this will use register XX but will damage its contents so it’s value is no longer available to later instructions”?



> On 11 Mar 2019, at 16:43, Quentin Colombet <qcolombet at apple.com> wrote:
> 
> Hi Carl,
> 
> Look at the comments in include/llvm/CodeGen/MachineOperand.h for the documentation of the various flags.
> 
> IsDead means that a definition is never used.
> IsKill means that this is the last use of a given register.
> 
> Cheers,
> -Quentin
> 
>> On Mar 11, 2019, at 8:54 AM, LLVM Mailing List via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>> 
>> Is there anything that documents what these properties (and the other similar properties) do on the MachineOperand class?
>> 
>> I’m trying to debug an instruction selection issue I think.  It’s hard to find documentation on what the MO properties mean.
>> 
>> Thanks,
>> Carl
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 

_______________________________________________
LLVM Developers mailing list
llvm-dev at lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list